ZMQ REP, knowing who send the request

后端 未结 2 2204
生来不讨喜
生来不讨喜 2021-02-20 02:44

I m currently using zmq with python. Server is using REP socket.

Do I have a way, when recv a message, to know who send it ? If a receive 2 messages, I just need to kno

2条回答
  •  名媛妹妹
    2021-02-20 02:58

    Reading http://zguide.zeromq.org/page%3aall#Transient-vs-Durable-Sockets, you can only get the identity of the socket you're working with... not the socket of any peers you're connected to.

    This being said, just build the sender information into the message. This should be trivial to do (either with a UUID or specific name per client).

提交回复
热议问题