}
#endif
-void socket_loop(int timeout_seconds) {
- if(sockets == NULL) return;
+int socket_loop(int timeout_seconds) {
+ if(sockets == NULL) return 0;
int is_synchronized = 1;
SYNCHRONIZE(synchronized_recv);
fd_set fds;
ret = select(ret + 1, &fds, NULL, NULL, &timeout);
if(ret == 0) {
DESYNCHRONIZE(synchronized_recv);
- return;
+ return 1;
}
for (sock = sockets->data; sock; sock = next) {
next = sock->next;
if(is_synchronized) {
DESYNCHRONIZE(synchronized_recv);
}
+ return (ret + 1);
}
void