Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Asio, 0MQ, and Windows
From: Damien Kick (dkick_at_[hidden])
Date: 2013-08-10 16:25:38


On Aug 10, 2013, at 5:51 AM, Bjorn Reese <breese_at_[hidden]<mailto:breese_at_[hidden]>>
 wrote:

Boost.Asio uses native_handle_type, which is a wrapper class for the
underlying socket type. In the case of Windows this is SOCKET. However,
you probably need to go via a intermediary variable:

  boost::asio::windows::stream_handle::native_handle_type handle(zfd);
  boost::asio::windows::stream_handle io(ios, handle);

Disclaimer: I have not compiled it. You may need to include something
from detail to make it work, or it may not work at all ;-)

Well, this at least compiles for me.

   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);
   boost::asio::windows::stream_handle::native_handle_type
       zfd_native(&zfd);
   boost::asio::io_service ios;
   boost::asio::windows::stream_handle io(ios, zfd_native);

I have no idea, yet, if that is a good thing or not ;-)

________________________________

This e-mail and any attachments are confidential. If it is not intended for you, please notify the sender, and please erase and ignore the contents.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net