1

I have the following setup:

zmq::proxy( acceptor, clients, nullptr );

My acceptor is a zmq::socket_type::stream and
my clients is a zmq::socket::type::dealer.

I am finding when the other end sends a large request (~ 16 [kB]), the request gets broken up and distributed to my dealer threads in pieces. One dealer gets the head of the message, others get pieces in the middle. I am not setting any special options so it seems like this is default zeromq behaviour.

I am using ZeroMQ 4.2.2.

Is there any way to override this behaviour and guarantee a delivery of a complete messages to my dealer threads?

user3666197
  • 1
  • 6
  • 50
  • 92
namdam
  • 11
  • 1

1 Answers1

1

@namdam deserved [+1] for posting version details

It there any wasy to override this... ?

Yes, kindly follow the API documented rules

A socket of type ZMQ_STREAM is used to send and receive TCP data from a non-ØMQ peer, when using the tcp:// transport. A ZMQ_STREAM socket can act as client and/or server, sending and/or receiving TCP data asynchronously.

Compatible peer sockets . . . . . none.

So either way, compose the proxy to handle compatible socket-archetypes ( w/o trying to hardwire ZMQ_STREAM into any other ZeroMQ native socket-archetype ) i.e. avoid using ZMQ_STREAM at all, or create a reading gateway, that decodes and mediates the ZMQ_STREAM compatible behaviour on one side and interfaces to other ZeroMQ native socket-archtypes on the other side of the gateway-logic.

If in doubts,
you may enjoy a read into the main conceptual differences
sketched in brief in the [ ZeroMQ hierarchy in less than a five seconds ] Section.

user3666197
  • 1
  • 6
  • 50
  • 92