From a58972056776e2f2588aed5a2dc0db7cc28f80b1 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 7 Mar 2016 12:12:36 +0100 Subject: io: implement socket watch for win32 using WSAEventSelect+select On Win32 we cannot directly poll on socket handles. Instead we create a Win32 event object and associate the socket handle with the event. When the event signals readyness we then have to use select to determine which events are ready. Creating Win32 events is moderately heavyweight, so we don't want todo it every time we create a GSource, so this associates a single event with a QIOChannel. Signed-off-by: Paolo Bonzini Signed-off-by: Daniel P. Berrange --- include/io/channel.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/io/channel.h b/include/io/channel.h index 0a1f1ce..d37acd2 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -78,6 +78,9 @@ typedef gboolean (*QIOChannelFunc)(QIOChannel *ioc, struct QIOChannel { Object parent; unsigned int features; /* bitmask of QIOChannelFeatures */ +#ifdef _WIN32 + HANDLE event; /* For use with GSource on Win32 */ +#endif }; /** -- cgit v1.1