Hi,

Currently we are developing a transport library for a TCP based client-server 
distributed system. We use the DEALER-ROUTER combo to connect our client to our 
servers (the relation is n to n). We also have an heartbeat system so both 
client and server can detect if the peer is not communicating.

My question is regarding the clean-up of the TCP sockets when a peer is blocked 
(not when the peer process dies, this works fine).

When, through heartbeat, the client detects that a server is not responding I 
close the corresponding DEALER socket. This in turns should close the 
underlying TCP socket. Is this assumption correct? If so we have no problem 
there.

However on the server side it is a different story. Currently we have a single 
ROUTER that is connected to all the client. If the server detects that a client 
is not responding I clean-up our connection object but do nothing with the 
ROUTER socket. So the TCP socket stays alive as long as the client doesn't exit 
or until it actively closes its socket. Is this correct? I'm afraid that this 
could be a potential problem in production if several clients got stuck and 
they pile up.

With ZeroMQ, is there a (relatively not hackish) way to force closing of a 
low-level TCP socket? We have a Java and a C++ implementation, they both must 
behave the same.

Thanks for reading!

Cheers,
Joel.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to