Async Watcher Issue on Windows
Anton Kirilov
akirilov at minervanetworks.com
Tue Feb 21 16:36:04 CET 2012
Hello,
> WriteFile explicitly refers to FILE_FLAG_OVERLAPPED, which cannot be set
> for sockets, at elast there is no known (to me) way to set it.
I understand your point. From my perspective overlapped mode is a common
property for all handles (file, socket, etc.), and it can be set in different
ways (e.g. CreateFile() with the FILE_FLAG_OVERLAPPED flag, WSASocket() with
the WSA_FLAG_OVERLAPPED flag, and so on) depending on the handle type. I agree
that the WriteFile() documentation is wrong/incomplete in the sense that it
explicitly concentrates on FILE_FLAG_OVERLAPPED, even though it acknowledges
that it can be used with socket handles, and that asynchronous write
operations are enabled on handles returned by the socket() function.
> However, something more sinister must be going on, as it apparently
> depends on the environment you are in (msvc. vs. mingw. for example, or
> probbaly os versions), otherwise we wouldn't see different behaviour.
My initial hunch was that it was more a case of a Visual C++ vs. MinGW
difference. In fact, I managed to reproduce the same problem on a fully updated
Windows Vista installation as well, again with Visual C++ Express 2010.
I will see if I can test on Windows 7. MinGW will be more of a challenge,
since I try with a whole project, not just small test programs, and the build
system is made for Visual C++.
Yours faithfully,
Anton Kirilov
More information about the libev
mailing list