[zeromq-dev] ZMQ_STREAM identity problem

Pieter Hintjens ph at imatix.com
Wed Oct 30 14:27:47 CET 2013

Sorry. You're right, the getsockopt retrieves the identity as a
client. When reading data, the first frame is an identity (ZMQ_STREAM
is a subclass of ZMQ_ROUTER).

Store the identity in a byte array of 255 bytes, and keep the length
as provided by getsockopt separately, then use that when you send it
back (you can simply use zmq_send, there's no reason to use zframe for

On Wed, Oct 30, 2013 at 1:14 PM, Chris Laws <clawsicus at gmail.com> wrote:
> I am not using a ROUTER socket. In my silly example I am using two
> ZMQ_STREAM sockets connected together as client and server. I understand I
> can use a ROUTER in raw mode when considering the a server scenario but in
> this instance I am more interested in the client scenario.
> My simple example code can be found here:
> https://gist.github.com/claws/7231548
> As you can see in the client example, I do a connect and then need to
> retrieve the socket identity so I can send the message. At least that's what
> I think I should be doing when using the ZMQ_STREAM socket in a client
> scenario. Is my usage not right?
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Pieter Hintjens
CEO of iMatix.com
Founder of ZeroMQ community
blog: http://hintjens.com

More information about the zeromq-dev mailing list