Mathias Gaunard
On 12/08/13 20:50, Damien Kick wrote:
And so, unless I'm once again missing something obvious (like casting a SOCKET into a HANDLE)
IIRC, with WINSOCK2, a SOCKET *is* a HANDLE.
Well, somebody forgot to tell 'boost::asio::windows::steam_handle' ;-) But, I'm very excited because I think I found a way to accomplish on Windows what I'd managed to get to work for me on POSIX, more or less. This at least compiles and if I'm correctly understanding the documentation for these functions that I've found online, then this might even do the Right Thing (TM) at runtime. Thanks in advance if anyone can help review this; i.e. somebody is already familiar with these Windows functions. zmq::context_t zenv(1); zmq::socket_t zocket(zenv, ZMQ_PUSH); SOCKET zfd; std::size_t zfd_size = sizeof(zfd); zocket.getsockopt(ZMQ_FD, &zfd, &zfd_size); auto event_handle = CreateEvent( nullptr, // default security settings false, // automatic reset false, // initial state is unsignalled nullptr); // anonymous object assert(event_handle != nullptr); auto err = WSAEventSelect(zfd, event_handle, FD_READ); assert(!err); boost::asio::io_service ios; boost::asio::windows::object_handle io(ios, event_handle); io.async_wait( [](const boost::system::error_code& err) { });