1

The code is here:



     using (var server = new ResponseSocket())
        {
            server.Bind("tcp://*:5555");

            while (true)
            {
                var message = server.ReceiveFrameString();

                Console.WriteLine("Received {0}", message);

                // processing the request
                Thread.Sleep(100);

                Console.WriteLine("Sending World");
                server.SendFrame("World");
            }
        }

You can read the complete topic at : http://netmq.readthedocs.io/en/latest/introduction/

The line which I don't understand is server.SendFrame("World");

How does the server know which client to send this message?

lcm
  • 531
  • 1
  • 5
  • 6

1 Answers1

1

Response socket always reply to the last client that sends a message.

Actually Response is wrapper of router socket, for router socket the first message part is the routing id, when using Response the socket first sends the routing id it just received and then your message part.

Bottom line, if you want to decide on the client getting the response use router.

Also read the zeromq guide:

http://zguide.zeromq.org/

somdoron
  • 4,653
  • 2
  • 16
  • 24