summaryrefslogtreecommitdiff
path: root/ot_socket.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-29 00:53:50 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-29 00:53:50 +0100
commit0f95c7d1056cab5bd8c6334cf601349ac4631457 (patch)
treec7c27709ef3695659ab4b743d7ae359d4ece272b /ot_socket.c
parent2812a6795149f68226e940212c511b7c625c81d5 (diff)
Revert last wake-up experiment. Having each udp worker wake up once a second to check if the tracker stops is wasteful
Diffstat (limited to 'ot_socket.c')
-rw-r--r--ot_socket.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/ot_socket.c b/ot_socket.c
index c73738c..158459f 100644
--- a/ot_socket.c
+++ b/ot_socket.c
@@ -9,7 +9,6 @@
9#include <netinet/in.h> 9#include <netinet/in.h>
10#include <string.h> 10#include <string.h>
11#include <sys/socket.h> 11#include <sys/socket.h>
12#include <sys/time.h>
13#include <unistd.h> 12#include <unistd.h>
14 13
15/* Opentracker */ 14/* Opentracker */
@@ -49,12 +48,6 @@ int socket_set_blocking(int s, int blocking) {
49 return fcntl(s, F_SETFL, blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK)); 48 return fcntl(s, F_SETFL, blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK));
50} 49}
51 50
52int socket_set_timeout(int s, int seconds) {
53 struct timeval patience = {seconds, 0};
54
55 return setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &patience, sizeof(patience));
56}
57
58static int set_nonblocking(int s) { return socket_set_blocking(s, 0); } 51static int set_nonblocking(int s) { return socket_set_blocking(s, 0); }
59 52
60/* Close without letting the failure we are about to report be overwritten */ 53/* Close without letting the failure we are about to report be overwritten */