[zeromq-dev] Using a ROUTER to direct messages to a new peer

Elliot Saba staticfloat at gmail.com
Wed Sep 28 21:54:04 CEST 2011


Hey Martin, for some reason it's not working for me.  My messages appear to
be dropped by the ROUTER socket before leaving the interface.

Does the introduction of the LABEL flag have anything to do with this?
 Right now I am sending the "address" of the peer I wish to talk to with
just a ZMQ_SNDMORE flag, do I need to use ZMQ_SNDLABEL or anything like
that?
-E

On Wed, Sep 28, 2011 at 5:10 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:

> Hi Elliot,
>
>
>  Hello, I'm trying to use a ROUTER socket to communicate to a new peer
>> that I have not received any messages from before.  I know that to use a
>> ROUTER socket to speak with this peer, I should prepend the peer's
>> identity in a separate message part, but I have no way of knowing what
>> identity this peer has, as I have not received any packets from it yet.
>>  (I am trying to make a peer to peer network using a ROUTER on each
>> peer to talk to the rest of the swarm, and this initial message is to
>> begin the handshake protocol to setup encryption, etc....)
>>
>> Is this a network design flaw on my end, or is there an easy way to get
>> a peer's ID that I don't know about?
>>
>
> In versions 2.x and 3.x you have ZMQ_IDENTITY option that allows you to set
> the identity by hand. (Thus you can know the identity of the peer in
> advance.)
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110928/7aecc71b/attachment.htm>


More information about the zeromq-dev mailing list