[Twisted-Python] Pulling the ethernet cable out

Alvin Delagon adelagon at gmail.com
Tue Feb 16 11:31:16 EST 2010


Hello Garyc,

This is not twisted's fault. Pulling a network plug doesn't tell the server
that the client went away immediately since the connection wasn't closed
properly. Pulling the plug produces TCP half-open scenario when one thinks
that the connection is still up. This can be remedied by
polling/hearbeat/keepalive logic. You can make your twisted server aware of
the keepalive timeouts by turning on setTcpKeepAlive to 1:

self.transport.setTcpKeepAlive(1)

Cheers,
Alvin


On Wed, Feb 17, 2010 at 12:15 AM, gary clark <burslem2001 at yahoo.com> wrote:

> Hello,
>
> I'm tested my client server model. The server being a twisted server.
> I am using the class NetstringReceiver. When I close down the client the
> appropriate call to close the connection is made "connectionLost". However
> when I just pull the client connection cable from the network. I would
> expect the call to be made to indicate a connection is lost at the twisted
> server. I dont see this.
>
> I am going through a local hub and not sure what at the moment to think of
> this. I am using ssl to communicate.
>
> If somebody could shed some light on this that would be great.
>
> Thanks,
> Garyc
>
>
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>



-- 
http://www.alvinatorsplayground.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100217/4a93ba1d/attachment.htm 


More information about the Twisted-Python mailing list