0
votes

I'm building a distributed system and I would like asynchronous send and recv from both sides with blocking after high water mark.

PUSH/PULL sockets works great, but I wasn't able to bind a PUSH socket. Meaning I can't have a client-PUSH to server-PULL and a server-PUSH to client-PULL, if the client is behind a firewall, since the server can't connect to the client.

In the book, the following is written, but I can't find an example of it. "REQ to DEALER: you could in theory do this, but it would break if you added a second REQ because DEALER has no way of sending a reply to the original peer. Thus the REQ socket would get confused, and/or return messages meant for another client." http://zguide.zeromq.org/php:chapter3

I only need a one-to-one connection, so this would in theory work for me.

My question is, what is the best practice to obtain asynchronous send and recv with ZeroMQ without dropping packets?

1

1 Answers

0
votes

Most ZeroMQ sockets can both bind (listen on a specific port, acting as a server) and connect (acting as a client). It is usually not related to the data flow. See the guide for more info.

Try to bind on your servers PUSH socket and connect from your clients PULL socket.