[IOMultiplexer] do not request events from closed descriptors
[ChatPrototype.git] / src / IOEngine_select.c
index 8c25ba6d1036309dcf2f7e1901dfccf18e95c805..2d85d7cc10f0f3b7e7f6bdf597573a3a47e39ea1 100644 (file)
@@ -99,6 +99,8 @@ static void engine_select_loop(struct timeval *timeout) {
             #endif
         }
         else if(iofd->type == IOTYPE_SERVER || iofd->type == IOTYPE_CLIENT) {
+            if(iofd->state == IO_CLOSED) 
+                continue;
             if(iofd->fd > fds_size)
                 fds_size = iofd->fd;
             FD_SET(iofd->fd, &read_fds);