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`.`internet`.`testing`.`StringTransportWithDisconnection``

class documentation

`class StringTransportWithDisconnection(StringTransport): (source)`

Constructor: `StringTransportWithDisconnection(hostAddress, peerAddress, lenient)`

View In Hierarchy

A `StringTransport` which on disconnection will trigger the connection lost on the attached protocol.

Method | `loseConnection` | Close the connection. Does nothing besides toggle the `disconnecting` instance variable to `True`.
Class Variable | `protocol` | Undocumented
Instance Variable | `connected` | Undocumented

Inherited from `StringTransport`:

Method | `__init__` | Undocumented
Method | `abortConnection` | Abort the connection. Same as `loseConnection`, but also toggles the `aborted` instance variable to `True`.
Method | `clear` | Discard all data written to this transport so far.
Method | `getHost` | Similar to getPeer, but returns an address describing this side of the connection.
Method | `getPeer` | Get the remote address of this connection.
Method | `pauseProducing` | Pause producing data.
Method | `registerProducer` | Register to receive data from a producer.
Method | `resumeProducing` | Resume producing data.
Method | `stopProducing` | Stop producing data.
Method | `unregisterProducer` | Stop consuming data from a producer, without disconnecting.
Method | `value` | Retrieve all data which has been buffered by this transport.
Method | `write` | Write some data to the physical connection, in sequence, in a non-blocking fashion.
Method | `writeSequence` | Write an iterable of byte strings to the physical connection.
Instance Variable | `disconnected` | A `bool` which is `False` until `abortConnection` is called, then `True`.
Instance Variable | `disconnecting` | A `bool` which is `False` until `loseConnection` is called, then `True`.
Instance Variable | `hostAddr` | `None` or an object which will be returned as the host address of this transport. If `None`, a nasty tuple will be returned instead.
Instance Variable | `io` | A `io.BytesIO` which holds the data which has been written to this transport since the last call to `clear`. Use `value` instead of accessing this directly.
Instance Variable | `peerAddr` | `None` or an object which will be returned as the peer address of this transport. If `None`, a nasty tuple will be returned instead.
Instance Variable | `producer` | If a producer is currently registered, `producer` is a reference to it. Otherwise, `None`.
Instance Variable | `producerState` | The state of this `StringTransport` in its capacity as an `IPushProducer`. One of `'producing'`, `'paused'`, or `'stopped'`.
Instance Variable | `streaming` | If a producer is currently registered, `streaming` refers to the value of the second parameter passed to `registerProducer`.
Method | `_checkState` | Undocumented
Instance Variable | `_lenient` | By default `StringTransport` enforces that `resumeProducing` is not called after the connection is lost. This is to ensure that any code that does call `resumeProducing` after the connection is lost is not blindly expecting ...

def loseConnection(self): (source)
from `twisted.internet.interfaces.ITransport`
overrides `twisted.internet.testing.StringTransport.loseConnection`

Close the connection. Does nothing besides toggle the `disconnecting` instance variable to `True`.

protocol: `IProtocol` = (source)

Undocumented

connected: `bool` = (source)
overrides `twisted.internet.testing.StringTransport.connected`

Undocumented