]> git.sesse.net Git - cubemap/blobdiff - cubemap.cpp
Make the list of sleeping clients be per-stream instead of global, so we do not wake...
[cubemap] / cubemap.cpp
index d5cfa010a1443782c37614903ae8fdeed905d7e6..008126c5c97273762b5144cf8a9d077efc940b5d 100644 (file)
@@ -79,7 +79,6 @@ int create_server_socket(int port)
 void *acceptor_thread_run(void *arg)
 {
        int server_sock = int(intptr_t(arg));
-       int num_accepted = 0;
        for ( ;; ) {
                sockaddr_in6 addr;
                socklen_t addrlen = sizeof(addr);
@@ -91,7 +90,8 @@ void *acceptor_thread_run(void *arg)
                }
                if (sock == -1) {
                        perror("accept");
-                       exit(1);
+                       usleep(100000);
+                       continue;
                }
 
                // Set the socket as nonblocking.
@@ -103,7 +103,6 @@ void *acceptor_thread_run(void *arg)
 
                // Pick a server, round-robin, and hand over the socket to it.
                servers->add_client(sock);
-               ++num_accepted; 
        }
 }