Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`protocols`.`policies`.`TimeoutMixin``

class documentation

`class TimeoutMixin: (source)`

Known subclasses: `twisted.mail.imap4.IMAP4Client`, `twisted.mail.imap4.IMAP4Server`, `twisted.mail.pop3.AdvancedPOP3Client`, `twisted.mail.pop3.POP3`, `twisted.mail.smtp.SMTP`, `twisted.mail.smtp.SMTPClient`, `twisted.protocols.ftp.FTP`, `twisted.protocols.memcache.MemCacheProtocol`, `twisted.protocols.postfix.PostfixTCPMapServer`, `twisted.web._http2.H2Connection`, `twisted.web.http.HTTPChannel`

View In Hierarchy

Mixin for protocols which wish to timeout connections.

Protocols that mix this in have a single timeout, set using `setTimeout`. When the timeout is hit, `timeoutConnection` is called, which, by default, closes 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.
Instance Variable | `timeOut` | The number of seconds after which to timeout the connection.
Method | `__timedOut` | Undocumented
Instance Variable | `__timeoutCall` | Undocumented

def callLater(self, period, func): (source)

Wrapper around `reactor.callLater` for test purpose.

def resetTimeout(self): (source)

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.

It's often a good idea to call this when the protocol has received some meaningful input from the other end of the connection. "I've got some data, they're still there, reset the timeout".

def setTimeout(self, period): (source)

Change the timeout period

Parameters
period:`int` or `None` | The period, in seconds, to change the timeout to, or `None` to disable the timeout.

def timeoutConnection(self): (source)
overridden in `twisted.mail.imap4.IMAP4Client`, `twisted.mail.imap4.IMAP4Server`, `twisted.mail.pop3.AdvancedPOP3Client`, `twisted.mail.smtp.SMTP`, `twisted.mail.smtp.SMTPClient`, `twisted.protocols.ftp.FTP`, `twisted.protocols.memcache.MemCacheProtocol`, `twisted.web._http2.H2Connection`, `twisted.web.http.HTTPChannel`

Called when the connection times out.

Override to define behavior other than dropping the connection.

timeOut: `Optional[int]` = (source)
overridden in `twisted.mail.imap4.IMAP4Server`, `twisted.mail.pop3.POP3`, `twisted.protocols.memcache.MemCacheProtocol`

The number of seconds after which to timeout the connection.

def __timedOut(self): (source)

Undocumented

__timeoutCall = (source)

Undocumented