Part of twisted.internet.tcp View Source View In Hierarchy
Known subclasses: twisted.internet.tcp.BaseClient, twisted.internet.tcp.Server
Implements interfaces: twisted.internet.interfaces.ISystemHandle, twisted.internet.interfaces.ITCPTransport, twisted.internet.interfaces.ITLSTransportI am the superclass of all socket-based FileDescriptors.
This is an abstract superclass of all objects which represent a TCP/IP connection based socket.Method | __init__ | Undocumented |
Method | startTLS | Undocumented |
Method | _startTLS | Undocumented |
Method | getHandle | Return the socket for this connection. |
Method | doRead | Calls self.protocol.dataReceived with all available data. |
Method | writeSomeData | Connection.writeSomeData(data) -> #of bytes written | CONNECTION_LOST |
Method | _closeWriteConnection | Undocumented |
Method | readConnectionLost | Indicates read connection was lost. |
Method | connectionLost | See abstract.FileDescriptor.connectionLost(). |
Method | logPrefix | Return the prefix to log with when I own the logging thread. |
Method | getTcpNoDelay | Return if TCP_NODELAY is enabled. |
Method | setTcpNoDelay | Enable/disable TCP_NODELAY. |
Method | getTcpKeepAlive | Return if SO_KEEPALIVE enabled. |
Method | setTcpKeepAlive | Enable/disable SO_KEEPALIVE. |
Inherited from FileDescriptor:
Method | doWrite | Called when data can be written. |
Method | _postLoseConnection | Called after a loseConnection(), when all data has been written. |
Method | writeConnectionLost | Indicates write connection was lost. |
Method | write | Reliably write some data. |
Method | writeSequence | Reliably write a sequence of data. |
Method | loseConnection | Close the connection at the next available opportunity. |
Method | loseWriteConnection | Undocumented |
Method | stopReading | Stop waiting for read availability. |
Method | stopWriting | Stop waiting for write availability. |
Method | startReading | Start waiting for read availability. |
Method | startWriting | Start waiting for write availability. |
Method | registerProducer | Register to receive data from a producer. |
Method | unregisterProducer | Stop consuming data from a producer, without disconnecting. |
Method | stopConsuming | Stop consuming data. |
Method | resumeProducing | Undocumented |
Method | pauseProducing | Undocumented |
Method | stopProducing | Stop producing data. |
Method | fileno | File Descriptor number for select(). |
Inherited from Ephemeral (via FileDescriptor):
Method | __getstate__ | Undocumented |
Method | __setstate__ | Undocumented |
Inherited from _SocketCloser:
Method | _closeSocket | Undocumented |
Calls self.protocol.dataReceived with all available data.
This reads up to self.bufferSize bytes of data from its socket, then calls self.dataReceived(data) to process it. If the connection is not lost through an error in the physical recv(), this function will return the result of the dataReceived call.Enable/disable TCP_NODELAY.
Enabling TCP_NODELAY turns off Nagle's algorithm. Small packets are sent sooner, possibly at the expense of overall throughput.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.