- WSAAsyncSelect(socket->m_fd, hWin, socket->m_msgnumber,
- FD_READ | FD_WRITE | FD_ACCEPT | FD_CONNECT | FD_CLOSE);
+ /* We could probably just subscribe to all events regardless
+ * of the socket type, but MS recommends to do it this way.
+ */
+ long lEvent = socket->m_server?
+ FD_ACCEPT : (FD_READ | FD_WRITE | FD_CONNECT | FD_CLOSE);
+
+ WSAAsyncSelect(socket->m_fd, hWin, socket->m_msgnumber, lEvent);