[Twisted-Python] Problems with long term connections?

Thomas Jacob jacob at internet24.de
Thu Feb 15 09:25:56 EST 2007


I would implement some sort of keep-alive mechanism
for those connections, something that will periodically do
some sort of ping/pong sequence (possibly even
using TCP's keepalive feature if that is available, anyone
know if Twisted can request it on at least some platforms?).

(Cf. for instance this 
http://libkeepalive.sourceforge.net/docs/TCP-Keepalive-HOWTO
)

This has at least two advantages, the first being
that will be able to know that the other side has gone
down, and that you will have to reopen your TCP
connection, the second being that there maybe various
state-full routers/firewalls in between your
communication endpoints that could possibly 
"age out" your connection if you do not send
any packets for some time.

The main disadvantage is that you generate data traffic even
if you do not actually do anything.

On Wed, 2007-02-14 at 17:46 +0000, John Pote wrote:
> Hi everyone,
> I am putting together a number of servers that will all communicate with 
> each other every 5 or 10 minutes via  TCP/IP connections. It occured to 
> me that once a connection has been established I might as well leave it 
> open permanently. Are there any problems/side effects of doing this? Is 
> it better policy to close and re-open the connection every now and then?
> 
> Also am I correct in assuming that if a computer at one end of a 
> TCP/IPconnection crashes or otherwise becomes unavailable the twisted 
> program at the other end will only know this when it attempts to send a 
> packet to the now crashed computer and, having no reply, gets a timeout.
> 
> Thanks for your help,
> John
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20070215/43c926bd/attachment.pgp 


More information about the Twisted-Python mailing list