0

I am new to Zero Mq. I am trying to implement an asynchronous request/reply pattern.

I have 1 server and N clients.

When a server receives a request from a client it passes this request to exactly one worker and waits until the worker has finished processing the request. The worker shall then send the reply back to the frontend socket which will then send it to the client.

The problem is that the socket.Send/SendMessage method does need a byte[] which does require to serialize my reply in the worker and then derserialize it back on the frontend.

Is there another way, where I do not need to serialize/deserialize? I would like to use the reference to the object itself, is this possible?

Thank you for your support.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
leozilla
  • 1,296
  • 2
  • 19
  • 29

1 Answers1

0

You can't do that. More, you don't want to do that, if you are using ZeroMQ you are working at a much lower level and are probably looking for speed and more control over your communications.

If you really want this I think you are looking for the concept of Remoting. Note that even here, you don't actually use the server reference, its just an illusion to make you feel like its the same but it involves significant overhead which is not in line with you wanting to use ZeroMQ.

NET-Remoting-with-an-easy-example

.Net Remoting versus WCF

Community
  • 1
  • 1
qwark
  • 493
  • 1
  • 4
  • 15
  • I already solved it by just sending the byte buffer from the backend to the frontend. – leozilla Feb 26 '14 at 19:10
  • Yes , in that case I know ZeroMQ suggest inproc but really if it is on the same process, use BlockingCollection its much faster and really easy to work with if you have access to this version of the framework. – qwark Feb 27 '14 at 10:55