mirror of
https://github.com/TokTok/c-toxcore
synced 2026-10-23 08:42:21 +00:00
This function only needs to be ran once per second when epoll is
enabled because all it does then is send pings and check timeouts which are calculated by the second.
This commit is contained in:
2 files changed
+8
No files matched your search
@@ -1031,6 +1031,13 @@ static void do_TCP_unconfirmed(TCP_Server *TCP_server)
|
||||
|
||||
static void do_TCP_confirmed(TCP_Server *TCP_server)
|
||||
{
|
||||
#ifdef TCP_SERVER_USE_EPOLL
|
||||
|
||||
if (TCP_server->last_run_pinged == unix_time())
|
||||
return;
|
||||
|
||||
TCP_server->last_run_pinged = unix_time();
|
||||
#endif
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < TCP_server->size_accepted_connections; ++i) {
|
||||
|
||||
@@ -110,6 +110,7 @@ typedef struct {
|
||||
|
||||
#ifdef TCP_SERVER_USE_EPOLL
|
||||
int efd;
|
||||
uint64_t last_run_pinged;
|
||||
#endif
|
||||
sock_t *socks_listening;
|
||||
unsigned int num_listening_socks;
|
||||
|
||||
Reference in new issue
Block a user