[gnet-dev] echoserver bug ?



Is this a bug in echoserver ?
Shouldn't it use gnet_tcp_socket_server_accept_nonblock ?
--- -	Thu Jun  7 10:49:43 2001
+++ echoserver.c	Thu Jun  7 10:48:30 2001
@@ -194,9 +194,10 @@
       GIOChannel* client_iochannel = NULL;
       ClientState* client_state = NULL;
 
-      client = gnet_tcp_socket_server_accept(server);
-      g_assert (client != NULL);
-
+      client = gnet_tcp_socket_server_accept_nonblock(server);
+      if (client == NULL) return TRUE; /* connection closed before calling */
+                                 /* gnet_tcp_socket_server_accept_nonblock */
+      
       client_iochannel = gnet_tcp_socket_get_iochannel(client);
       g_assert (client_iochannel != NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]