Make edge-triggering more consistent.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 7 Apr 2013 21:13:43 +0000 (23:13 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 7 Apr 2013 21:13:43 +0000 (23:13 +0200)
server.cpp

index 94350fa..7cdfd17 100644 (file)
@@ -201,13 +201,15 @@ void Server::add_client(int sock)
 
        // Start listening on data from this socket.
        epoll_event ev;
-       ev.events = EPOLLIN | EPOLLRDHUP;
+       ev.events = EPOLLIN | EPOLLET | EPOLLRDHUP;
        ev.data.u64 = 0;  // Keep Valgrind happy.
        ev.data.fd = sock;
        if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, sock, &ev) == -1) {
                perror("epoll_ctl(EPOLL_CTL_ADD)");
                exit(1);
        }
+
+       process_client(&clients[sock]);
 }
 
 void Server::add_client_from_serialized(const ClientProto &client)