server: Explicitly shutdown destroyed sockets to force pending poll() calls to return.
diff --git a/server/sock.c b/server/sock.c
index a98057f..7c96f5f 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -583,7 +583,12 @@
async_terminate_queue( &sock->write_q, STATUS_CANCELLED );
}
if (sock->event) release_object( sock->event );
- if (sock->fd) release_object( sock->fd );
+ if (sock->fd)
+ {
+ /* shut the socket down to force pending poll() calls in the client to return */
+ shutdown( get_unix_fd(sock->fd), SHUT_RDWR );
+ release_object( sock->fd );
+ }
}
/* create a new and unconnected socket */