On 07/03/2016 08:23, Andrew Baumann wrote:
> Without having looked very closely at the code, I suspect the problem
> may be that we've lost the special-case treatment of socket handles as
> distinct from file descriptors on Win32 (they are different namespaces,
> and different APIs are needed). The previous version of qemu-char.c
> special-cased sockets in io_channel_from_socket():
> 
> -#ifdef _WIN32
> -    chan = g_io_channel_win32_new_socket(fd);
> -#else
> -    chan = g_io_channel_unix_new(fd);
> -#endif
> 
> ... but I don't see anything equivalent in io/channel-socket.c. Am I
> looking in the wrong place?

You're right, we need to add a qio_channel_create_socket_watch, which
just calls qio_channel_create_fd_watch on Unix but uses select and
WSAEnumNetworkEvents on Win32.  I have already implemented this trick in
aio-win32.c for networked block devices.

Andrew or Daniel, it would be great if you added a failing testcase to
test-io-channel-socket.c.  I can work on the fix myself.

Paolo

Reply via email to