[zeromq-dev] How do I get the sock fd of the client while receiving the message using zmq_msg_recv()?
Doron Somech
somdoron at gmail.com
Tue Jul 19 08:39:47 CEST 2016
You can call zmq_msg_get with ZMQ_SRCFD, however this option is deprecated
and I don't recommend it.
Instead you can call the zmq_msg_gets to get metadata about the socket,
right now only "Peer-Address" is supported but it is pretty easy to add
more properties.
If you want to add more this is the place
https://github.com/zeromq/libzmq/blob/master/src/stream_engine.cpp#L984
On Tue, Jul 19, 2016 at 8:43 AM, Bharat Somani <bharatdsomani at gmail.com>
wrote:
>
> I am using ZMQ zmq_msg_recv() for receiving client connections and
> requests, How do I get the sock fd of the client who has sent this message?
> I have read somewhere that this feature is added in ZMQ 4 but somehow not
> able to locate which API gives the sock fd.
>
> Any pointers in this regards?
>
> Regards,
> Bharat
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160719/b531ce98/attachment.htm>
More information about the zeromq-dev
mailing list