Part of twisted.protocols.policies View Source View In Hierarchy
Known subclasses: twisted.mail.imap4.IMAP4Client, twisted.mail.imap4.IMAP4Server, twisted.mail.pop3.POP3, twisted.mail.pop3client.POP3Client, twisted.mail.smtp.SMTP, twisted.mail.smtp.SMTPClient, twisted.protocols.ftp.FTP, twisted.protocols.memcache.MemCacheProtocol, twisted.protocols.postfix.PostfixTCPMapServer, twisted.web.http.HTTPChannel
Mixin for protocols which wish to timeout connections.
Protocols that mix this in have a single timeout, set usingsetTimeout
.
When the timeout is hit, timeoutConnection
is called, which, by default, closes the connection.
Class Variables | timeOut | The number of seconds after which to timeout the connection. |
Method | callLater | Wrapper around reactor.callLater for test purpose.
|
Method | resetTimeout | Reset the timeout count down. |
Method | setTimeout | Change the timeout period |
Method | timeoutConnection | Called when the connection times out. |
Method | __timedOut | Undocumented |
Reset the timeout count down.
If the connection has already timed out, then do nothing. If the
timeout has been cancelled (probably using setTimeout(None)
),
also do nothing.
Parameters | period | The period, in seconds, to change the timeout to, or None
to disable the timeout.
(type: int or NoneType
) |
Called when the connection times out.
Override to define behavior other than dropping the connection.