OK I think I finally get the ZMQ_PAIR concept.

From Wikipedia:
Monogamy is a form of relationship in which an individual has only one partner 
during their lifetime — alternately, only one partner at any one time (serial 
monogamy)

A ZMQ_PAIR concept is  *monogamy*

I originally thought it was *serial monogamy*

I will let it go now :)



-----Original Message-----
From: zeromq-dev <[email protected]> On Behalf Of Luca 
Boccassi
Sent: 20 June 2018 16:33
To: ZeroMQ development list <[email protected]>
Subject: Re: [zeromq-dev] ZMQ_PAIR over TCP

As I mentioned, only one pipe is accepted at any given time. Just because 
externally it seems like the connection has dropped, it doesn't mean the TCP 
socket is gone yet and thus the pipe will still be there, and further 
connection will be refused.

Your best bet is to try and use the heartbeat options with aggressive timings, 
which should cause the binding side to drop the dead pipe much faster.

But in the end, PAIR is meant to be used between two endpoints, hence the name 
- if one disappears and another arrives, it's no longer a pair, and as they 
say, three's a crowd.

On Wed, 2018-06-20 at 14:33 +0000, James Harvey wrote:
> Yes it does work over TCP and it does attempt to reconnect when you 
> restart the bind end.
> 
> In the background the zmq::tcp_connector attempts to make the 
> reconnection. It does all the right things and ends up in 
> zmq::tcp_connecter_t::out_event and calls the last line _socket-
> >event_connected (_endpoint, fd);
> 
> After this all looks good in terms of TCP, the connection is 
> established BUT no messages flow.
> 
> I have been looking through the code trying to work out why ZMQ_PAIR 
> never supported reconnection. Is it related to the fact it was 
> originally designed for inproc which doesn’t support reconnect? https
> ://github.com/zeromq/libzmq/blob/6bfa91f13f73b67be47ded18986b76d154d5
> 923b/src/socket_base.cpp#L685
> 
> It seems odd though as I use PUB/SUB/PUSH/PULL over inproc and TCP but 
> those patterns are not excluded from reconnect just because they can 
> be used over inproc.
> 
> 
> 
> From: zeromq-dev <[email protected]> On Behalf Of 
> vincent freedom
> Sent: 20 June 2018 04:48
> To: [email protected]
> Subject: Re: [zeromq-dev] ZMQ_PAIR over TCP
> 
> Nope, it doesn't reconnect. It looks like it does work over tcp 
> though.
> 
> https://pastebin.com/e42ysUAy
> https://pastebin.com/jbi1KA3n
> 
> Run the client for the second time and it won't receive any messages.
> 
> -vf
> 
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

--
Kind regards,
Luca Boccassi
_______________________________________________
zeromq-dev mailing list
[email protected]
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to