I am trying to implement an inter-process communication.
The model: Part A -> Sends messages to Part B.
I have implemented this using Client-Server example from ZMQ
tutorial (code attached bellow), but facing issues that the process is "locked".
What is the best practice to implement this kind of model?
It is not classic "Client-Server". Actually just one part sends data to the second part, and second part uses it.
Is there an option to send a message with a timeout, that it will not lock the process?
Any input / example will be very appreciated!
Server:
zmq::context_t context(1);
zmq::socket_t socket(context, ZMQ_REP);
socket.bind("tcp://*:5555");
..
socket.recv(&request); // SERVER.receives first
socket.send(reply); // SERVER.sends next to Client
.. // .analyze .recv'd data
Client:
requester = context.socket(ZMQ.REQ);
requester.connect("tcp://localhost:5555");
requester.send(str.getBytes(), 0); // CLIENT.sends
byte[] reply = requester.recv(0); // CLIENT.receives