Can anyone explain the request-reply broker zeromq example?

I'm refering to the 'A Request-Reply Broker' in the Zeromq documentation: http://zguide.zeromq.org/chapter:all

I'm getting the general gist of the app: it acts like an intermediary and routes messages from the client to the server and back again.

What I'm not getting though is how it makes sure the correct response from a server is sent to the correct client which originally made the request. I don't see anything in the code example which makes sure about this.

Now in the example they only send 1 message (hello) and 1 response (world), so even if messages are mixed up it doesn't matter, but I'm guessing that the testclient and server are kept deliberately simple.

Any thoughts are welcome...

6
задан Mogsdad 19 January 2018 в 21:25
поделиться