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`.`interfaces`.`ITransport``

interface documentation

`class ITransport(Interface): (source)`

Known subclasses: `twisted.conch.insults.insults.ITerminalTransport`, `twisted.conch.telnet.ITelnetTransport`, `twisted.internet.interfaces.IProcessTransport`, `twisted.internet.interfaces.ITCPTransport`, `twisted.internet.interfaces.IUNIXTransport`

Known implementations: `twisted.conch.ssh.channel.SSHChannel`, `twisted.conch.ssh.session.SSHSessionProcessProtocol`, `twisted.internet._posixstdio.StandardIO`, `twisted.internet.abstract.FileDescriptor`, `twisted.internet.iocpreactor.abstract.FileHandle`, `twisted.internet.protocol.FileWrapper`, `twisted.internet.stdio.StandardIO`, `twisted.internet.testing.StringTransport`, `twisted.protocols.loopback.LoopbackRelay`, `twisted.trial._dist.worker.LocalWorkerTransport`, `twisted.web._http2.H2Stream`, `twisted.web.http.HTTPChannel`, `twisted.protocols.loopback._LoopbackTransport`

View In Hierarchy

I am a transport for bytes.

I represent (and wrap) the physical connection and synchronicity of the framework which is talking to the network. I make no representations about whether calls to me will happen immediately or require returning to a control loop, or whether they will happen in the same or another thread. Consider methods of this class (aside from getPeer) to be 'thrown over the wall', to happen at some indeterminate time.

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 | `loseConnection` | Close my connection, after writing all pending data.
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.

def getHost(): (source)
overridden in `twisted.internet.interfaces.ITCPTransport`

Similar to getPeer, but returns an address describing this side of the connection.

Returns
`IAddress` | An `IAddress` provider.

def getPeer(): (source)
overridden in `twisted.internet.interfaces.ITCPTransport`

Get the remote address of this connection.

Treat this method with caution. It is the unfortunate result of the CGI and Jabber standards, but should not be considered reliable for the usual host of reasons; port forwarding, proxying, firewalls, IP masquerading, etc.

Returns
`IAddress` | An `IAddress` provider.

def loseConnection(): (source)
overridden in `twisted.internet.interfaces.IProcessTransport`

Close my connection, after writing all pending data.

Note that if there is a registered producer on a transport it will not be closed until the producer has been unregistered.

def write(data): (source)

Write some data to the physical connection, in sequence, in a non-blocking fashion.

If possible, make sure that it is all written. No data will ever be lost, although (obviously) the connection may be closed before it all gets through.

Parameters
data:`bytes` | The data to write.

def writeSequence(data): (source)

Write an iterable of byte strings to the physical connection.

If possible, make sure that all of the data is written to the socket at once, without first copying it all into a single byte string.

Parameters
data:`Iterable[bytes]` | The data to write.