Implements interfaces: 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__ Undocumented
Method write Write some data to the physical connection, in sequence, in a non-blocking fashion.
Method registerProducer From abstract.FileDescriptor
Method unregisterProducer Undocumented
Method stopConsuming Undocumented
Method writeSequence Write an iterable of byte strings to the physical connection.
Method loseConnection Close my connection, after writing all pending data.
Method getPeer Get the remote address of this connection.
Method getHost Similar to getPeer, but returns an address describing this side of the connection.
Method handleException Undocumented
Method resumeProducing Undocumented
Method pauseProducing Undocumented
Method stopProducing Undocumented
Method _checkProducer Undocumented
def __init__(self, file):
Undocumented
def write(self, data):

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.

ParametersdataThe data to write. (type: bytes)
def _checkProducer(self):
Undocumented
def registerProducer(self, producer, streaming):

From abstract.FileDescriptor

def unregisterProducer(self):
Undocumented
def stopConsuming(self):
Undocumented
def writeSequence(self, iovec):

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.

ParametersdataThe data to write. (type: an iterable of bytes)
def loseConnection(self):

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 getPeer(self):

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.

ReturnsAn IAddress provider.
def getHost(self):

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

ReturnsAn IAddress provider.
def handleException(self):
Undocumented
def resumeProducing(self):
Undocumented
def pauseProducing(self):
Undocumented
def stopProducing(self):
Undocumented
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.