It is a different sockets (sock2 and mSock), therefore the ack from C will be received.
On Thu, Oct 10, 2019, 10:50 Tomasz Michalski <[email protected]> wrote: > One correction: > //Send resp to machine B (not A) > mSock.send(msgAck) > } > > czw., 10 paź 2019 o 09:45 Tomasz Michalski <[email protected]> > napisał(a): > >> Hi >> I have three machines. On each of them there is daemon app which perform >> role as server REP and bind to "tcp://*:5555". Moreover on each machine >> one-shoot tool can be started by user in runtime which behaves as client - >> create socket on port 5555, >> connect("tcp://concreteIpAddressGivenByUserOnArgList::5555"), send msg, >> destroy socket and exit. >> >> Here is the most complex case which come to my mind. Will it work? >> >> server on machine A: >> { >> mSock.bind("tcp://*:5555"); >> mSock.recv(msg) >> >> //(Machine B sends to machine A msg) >> based on header I start concrete handler, in particular it may be >> handler which send msg2 to machine C >> { >> //Machine A in server process scope sends to machine C msg2 >> //create temporary client sock2: >> sock2.connect("tcp://anotherMachineIpAddr:5555"); >> sock2.send(msg2); >> sock2.recv(msg2Ack); (*) -> please see below on machine C use case >> //destroy sock2 >> } >> >> //Send resp to machine A >> mSock.send(msgAck) >> } >> >> Machine C: >> server App: gets msg2 from machine A, process it >> in the meantime someone starts tool which connect to machine A and send >> msg3 >> server App: ack for msg2 is sent to machine A >> >> The question is what message will be received at machine A server at this >> point (*). Will it be msg3 or ack for msg2? >> >> Another more complex case, what will happen if machine C will be machine >> B?! Will here occur deadlock? >> >> Thanks in advance for response >> BR >> Tomek >> >> >> >> _______________________________________________ > zeromq-dev mailing list > [email protected] > https://lists.zeromq.org/mailman/listinfo/zeromq-dev >
_______________________________________________ zeromq-dev mailing list [email protected] https://lists.zeromq.org/mailman/listinfo/zeromq-dev
