class FileWrapper: (source)
Constructor: FileWrapper(file)
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 | get |
Similar to getPeer, but returns an address describing this side of the connection. |
Method | get |
Get the remote address of this connection. |
Method | handle |
Undocumented |
Method | lose |
Close my connection, after writing all pending data. |
Method | pause |
Undocumented |
Method | register |
From abstract.FileDescriptor |
Method | resume |
Undocumented |
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 | disconnecting |
Undocumented |
Instance Variable | closed |
Undocumented |
Instance Variable | file |
Undocumented |
Instance Variable | producer |
Undocumented |
Instance Variable | streaming |
Undocumented |
Method | _check |
Undocumented |
Similar to getPeer, but returns an address describing this side of the connection.
Returns | |
An IAddress provider. |
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.
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. |