Hi Goswin,
Thank you for your reply.

How can the QUEUE know which one of sockets is the recipient that
corresponds to "Jerry", and how can it route to it?

On Mon, Sep 29, 2014 at 2:21 AM, Goswin von Brederlow <[email protected]>
wrote:

> On Sun, Sep 28, 2014 at 07:17:39PM -0700, Roberto Ostinelli wrote:
> > Hello 0mq'ers!
> > I'm investigating 0MQ and up until know I'm enjoying what I'm seeing.
> >
> > As an academical exercise, I'm trying to understand how to build a
> simple server that can route a REQ to a very specific Socket based on a
> "friendly name", and receive a RES from it.
> >
> > For instance, let's say I have two clients, "Tom" and "Jerry", that
> somehow authenticate on a server.
> > I want to be able to have Tom send a REQ specifically to "Jerry", and
> receive a RES, via a server (i.e. not by a direct connection).
> >
> > I've seen the examples on how to create a QUEUE device to route XREQ and
> XRES, however in these examples there are clients on one side and servers
> on the other, and when a client sends a request, any server on the other
> side can provide the response. I'd like to have a way for the client "Tom"
> to specify that it wants its response from the server "Jerry".
> >
> > Can a kind soul point me in the right direction?
> >
> > Thank you in advance.
> > r.
>
> What I do in my code is to use the same syntax as ROUTER sockets. You
> send the recipient "Jerry" as first frame of the message and have the
> QUEUE device use that frame to direct the rest of the message. In my
> case the outgoing end is a ROUTER socket to I just pass the whole
> message on, including the recipient frame and the ROUTER socket sends
> it the right way.
>
> MfG
>         Goswin
> _______________________________________________
> 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

Reply via email to