[zeromq-dev] equivalent of accept

Martin Sustrik sustrik at 250bpm.com
Tue Apr 20 18:09:39 CEST 2010


Varol,

>     zmq_msg_init (&query);
>     zmq_recv ( pSocket, &query, 0 );
>     zmq_msg_close (&query);
> 
>     // How do I take the client connection here to a ZMQ_P2P in a new thread ?
>     // Specify port 0 to bind(), and the OS will pick an unused port, 
>     // then use getsockname() to find out which port was chosen.
>    ClientHandler *p = new ClientHandler;
>     p->startThread ( );

What are you trying to do here?

If what you want to do is to reply to the request, simply construct the 
reply and send it back to the REP socket:

zmq_send (pSocket, &reply);

Martin



More information about the zeromq-dev mailing list