Hi Mark, ROUTER sockets can be used to do sends and receives in any order. See Send/receive pattern for it here: http://api.zeromq.org/3-2:zmq-socket
Anoop A. Mark wrote: > > Hi Anoop! > > As I understand ZMQ_ROUTER sockets are like ZMQ_REP socket in that they > must receive a msg first. You cannot send a msg off the ZMQ_ROUTER > socket without it already had received a > msg first. In your example you send to the broker first. Also in your > loop there should be REQ-REP pattern eventually somewhere. > > -Mark > > On Mon, Mar 25, 2013 at 4:53 PM, Anoop Karollil > <[email protected] <mailto:[email protected]>> wrote: > > Hello, > > I am using ZeroMQ 3.2.2 and PyZMQ 13.0.0. > > When I try sending messages via a ROUTER socket to a ROUTER socket > (both having their identities set), with ZMQ_ROUTER_MANDATORY set, > the initial send of the destination sock identity (sent before > actual message for routing) fails once, but succeeds after. > > Please see attached C or Python file which reproduces the behavior. > It seems to happen only if the SNDMORE option is set - which if my > understanding is correct is what should be done while sending the > destination socket identity, before the actual message is sent with > the SNDMORE flag unset. > > Is this intended behavior or am I doing something wrong? > > The C program gives the following output: > > > Sending address... > Error: No route to host > Sending address... > Success! > Sending Hello... > Success! > > > > Thanks, > Anoop > > _______________________________________________ > zeromq-dev mailing list > [email protected] <mailto:[email protected]> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > > > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
