class FakeTransport: (source)
Known subclasses: twisted.conch.test.test_endpoints.AbortableFakeTransport
Implements interfaces: twisted.internet.interfaces.ITLSTransport
, twisted.internet.interfaces.ITransport
A wrapper around a file-like object to make it behave as a Transport.
This doesn't actually stream the file to the attached protocol, and is thus useful mainly as a utility for debugging protocols.
Method | __init__ |
No summary |
Method | __repr__ |
Undocumented |
Method | abort |
For the time being, this is the same as loseConnection; no buffered data will be lost. |
Method | buffer |
Undocumented |
Method | get |
Similar to getPeer, but returns an address describing this side of the connection. |
Method | get |
Get the pending writes from this transport, clearing them from the pending buffer. |
Method | get |
Get the remote address of this connection. |
Method | get |
Return if SO_KEEPALIVE is enabled. |
Method | get |
Return if TCP_NODELAY is enabled. |
Method | log |
Identify this transport/event source to the logging system. |
Method | lose |
Close my connection, after writing all pending data. |
Method | lose |
Half-close the write side of a TCP connection. |
Method | pause |
Undocumented |
Method | register |
From abstract.FileDescriptor |
Method | report |
Undocumented |
Method | resume |
Undocumented |
Method | set |
Enable/disable SO_KEEPALIVE. |
Method | set |
Enable/disable TCP_NODELAY. |
Method | start |
Initiate TLS negotiation. |
Method | stop |
Undocumented |
Method | stop |
Undocumented |
Method | unregister |
Undocumented |
Method | write |
Write some data to the physical connection, in sequence, in a non-blocking fashion. |
Method | write |
Write an iterable of byte strings to the physical connection. |
Class Variable | closed |
Undocumented |
Class Variable | disconnected |
Undocumented |
Class Variable | disconnect |
Undocumented |
Instance Variable | disconnecting |
Undocumented |
Instance Variable | host |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | peer |
Undocumented |
Instance Variable | producer |
Undocumented |
Instance Variable | protocol |
Undocumented |
Instance Variable | serial |
Undocumented |
Instance Variable | stream |
Undocumented |
Instance Variable | streaming |
Undocumented |
Instance Variable | tls |
Undocumented |
Instance Variable | tlsbuf |
Undocumented |
Method | _check |
Undocumented |
Class Variable | _nextserial |
Undocumented |
Parameters | |
protocol:IProtocol provider | This transport will deliver bytes to this protocol. |
isbool | True if this is the accepting side of the connection, False if it is the connecting side. |
hostIAddress provider or None | The value to return from getHost. None results in a new FakeAddress being created to use as the value. |
peerIAddress provider or None | The value to return from getPeer. None results in a new FakeAddress being created to use as the value. |
twisted.conch.test.test_endpoints.AbortableFakeTransport
For the time being, this is the same as loseConnection; no buffered data will be lost.
Similar to getPeer, but returns an address describing this side of the connection.
Returns | |
An IAddress provider. |
Get the pending writes from this transport, clearing them from the pending buffer.
Returns | |
bytes | the bytes written with transport.write |
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 | |
An IAddress provider. |
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.
Half-close the write side of a TCP connection.
If the protocol instance this is attached to provides IHalfCloseableProtocol, it will get notified when the operation is done. When closing write connection, as with loseConnection this will only happen when buffer has emptied and there is no registered producer.
Enable/disable SO_KEEPALIVE.
Enabling SO_KEEPALIVE sends packets periodically when the connection is otherwise idle, usually once every two hours. They are intended to allow detection of lost peers in a non-infinite amount of time.
Enable/disable TCP_NODELAY.
Enabling TCP_NODELAY turns off Nagle's algorithm. Small packets are sent sooner, possibly at the expense of overall throughput.
Initiate TLS negotiation.
Parameters | |
contextIOpenSSLClientConnectionCreator or IOpenSSLServerConnectionCreator , depending on whether this ITLSTransport is a server or not. If the appropriate interface is not provided by the value given for contextFactory, it must be an implementor of IOpenSSLContextFactory . | An object which creates appropriately configured TLS connections. For clients, use |
be | Undocumented |
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 | The data to write. |