From 586ea44b9a2750c7c2bd7e8ccbee2483e8398b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=BBak?= Date: Fri, 28 Jun 2019 10:16:30 +0200 Subject: [PATCH] [#70] io/channel-watch.c: Correctly associate socket handle with its corresponding event. (#71) Add WSAEventSelect() for Windows. --- io/channel-watch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/io/channel-watch.c b/io/channel-watch.c index cf1cdff896..8640d1c464 100644 --- a/io/channel-watch.c +++ b/io/channel-watch.c @@ -285,6 +285,12 @@ GSource *qio_channel_create_socket_watch(QIOChannel *ioc, GSource *source; QIOChannelSocketSource *ssource; +#ifdef WIN32 + WSAEventSelect(socket, ioc->event, + FD_READ | FD_ACCEPT | FD_CLOSE | + FD_CONNECT | FD_WRITE | FD_OOB); +#endif + source = g_source_new(&qio_channel_socket_source_funcs, sizeof(QIOChannelSocketSource)); ssource = (QIOChannelSocketSource *)source;