Damien Kick <dkick1 <at> mac.com> writes:
> Well, the reason that I want to integrate with Boost.Asio is more
> for getting its implementation of the reactor pattern "for free",
> including timers, etc.
And I've pretty much resigned myself that in this case, what's good
for the POSIX is certainly not good for the Windows, using Boost 1.54
and either GCC 4.8 or Visual Studio 2010. On POSIX, this works fine
zmq::context_t zenv(1);
zmq::socket_t zocket(zenv, ZMQ_PUSH);
int zfd;
std::size_t zfd_size = sizeof(zfd);
zocket.getsockopt(ZMQ_FD, &zfd, &zfd_size);
boost::asio::io_service ios;
boost::asio::posix::stream_descriptor io(ios, zfd);
io.async_read_some(
boost::asio::null_buffers(),
[](const boost::system::error_code& err, std::size_t) { });
// ...
But this won't even compile on Windows
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);
HANDLE handle = (HANDLE)zfd;
boost::asio::io_service ios;
boost::asio::windows::stream_handle io(ios, handle);
io.async_read_some(
boost::asio::null_buffers(),
[](const boost::system::error_code& err, std::size_t) { });
// ...
Complaining that:
2>.../stream_handle_service.hpp(195): error C2248: \
'boost::asio::detail::win_iocp_handle_service::async_read_some' : \
cannot access private member declared in class \
'boost::asio::detail::win_iocp_handle_service'
Apparently, this function has been explicitly disabled for a
windows::stream_handle,probably for reasons related to IOCP (?), about
which I know next to nothing.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev