From ff47441713de4efce3333a955f02fe842b986e69 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 28 Jan 2013 11:23:52 +0800 Subject: [PATCH] ensure accept is nonblocking Signed-off-by: Andy Green --- lib/server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/server.c b/lib/server.c index 7c037b2..54a5405 100644 --- a/lib/server.c +++ b/lib/server.c @@ -222,6 +222,9 @@ int lws_server_socket_service(struct libwebsocket_context *context, setsockopt(accept_fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&opt, sizeof(opt)); + /* We are nonblocking... */ + fcntl(accept_fd, F_SETFL, O_NONBLOCK); + /* * look at who we connected to and give user code a chance * to reject based on client IP. There's no protocol selected -- 2.7.4