[Twisted-Python] Pulling the ethernet cable out

Alec Matusis matusis at yahoo.com
Tue Feb 16 15:47:07 EST 2010


Assuming you are on Linux, you can run

#man tcp 

and take a look at the tunable parameters that control TCP protocol
timeouts:

tcp_keepalive_intvl
tcp_keepalive_probes
tcp_keepalive_time

They can be tuned via /proc filesystem.
These changes are system-wide, so you should consider the performance of
other applications on this system with those changes.

> -----Original Message-----
> From: twisted-python-bounces at twistedmatrix.com [mailto:twisted-python-
> bounces at twistedmatrix.com] On Behalf Of gary clark
> Sent: Tuesday, February 16, 2010 10:19 AM
> To: Twisted general discussion
> Subject: Re: [Twisted-Python] Pulling the ethernet cable out
> 
> Hey Alvin,
> 
> In the document link you provided the packets are being sent periodically
> every 2 hours for setTcpKeepAlive(1). I am assuming that
> the a packet is sent straight away and then waits. At the moment I dont
see
> the connection lost. The getTcpKeepAlive() is returning 1 indicating that
keep
> alive is set.
> 
> Is there a way to change the delay?
> 
> Thanks,
> Garyc
> 
> 
> 
> --- On Tue, 2/16/10, Alvin Delagon <adelagon at gmail.com> wrote:
> 
> > From: Alvin Delagon <adelagon at gmail.com>
> > Subject: Re: [Twisted-Python] Pulling the ethernet cable out
> > To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
> > Date: Tuesday, February 16, 2010, 11:19 AM
> > Hello,
> > No, getTcpKeepAlive will only tell you if
> > SO_KEEPALIVE is enabled. It's setTcpKeepAlive you want.
> > If it's enabled, once the keepalive times out on a
> > half-open scenario, the connectionLost method will be
> > triggered. You can read the API docs here:
> >
> >
> http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.tcp.Connecti
> on.html#getTcpKeepAlive
> >
> http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.tcp.Connecti
> on.html#setTcpKeepAlive
> >
> > Best Regards,Alvin
> >
> > On Wed, Feb 17, 2010 at 1:06 AM,
> > gary clark <burslem2001 at yahoo.com>
> > wrote:
> >
> > I have to
> > poll at the twisted server "getTcpKeepAlive" for
> > the state of the keep alive.
> >
> >
> >
> >
> >
> > Thanks,
> >
> > Garyc
> >
> >
> >
> > --- On Tue, 2/16/10, gary clark <burslem2001 at yahoo.com>
> > wrote:
> >
> >
> >
> > > From: gary clark <burslem2001 at yahoo.com>
> >
> > > Subject: [Twisted-Python] Pulling the ethernet cable
> > out
> >
> > > To: "Twisted general
> > discussion" <twisted-python at twistedmatrix.com>
> >
> > > Date: Tuesday, February 16, 2010, 10:15 AM
> >
> > > 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
> >
> > >
> >
> >
> >
> >
> >
> > _______________________________________________
> >
> > Twisted-Python mailing list
> >
> > Twisted-Python at twistedmatrix.com
> >
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> >
> >
> >
> >
> > --
> > http://www.alvinatorsplayground.blogspot.com/
> >
> >
> >
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Twisted-Python mailing list
> > Twisted-Python at twistedmatrix.com
> > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> >
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list