Home | Trees | Index | Help |
|
---|
Package twisted :: Package internet :: Module tcp :: Class Port |
|
Ephemeral
--+ |Logger
--+ |FileDescriptor
--+ |BasePort
--+ | Port
Port
,
Port
I am a TCP server port, listening for connections.
When a connection is accepted, I will call my factory's buildProtocol with the incoming connection as an argument, according to the specification described in twisted.internet.interfaces.IProtocolFactory.
If you wish to change the sort of transport that will be used, my `transport' attribute will be called with the signature expected for Server.__init__, so it can be replaced.Method Summary | |
---|---|
Initialize with a numeric port to listen on. | |
__repr__(self)
| |
_buildAddr(self,
(host,
port))
| |
_preMakeConnection(self,
transport)
| |
Cleans up my socket. | |
createInternetSocket(self)
| |
Called when my socket is ready for reading. | |
Returns an IPv4Address. | |
Returns the name of my class, to prefix log entries with. | |
Stop accepting connections on this port. | |
Create and bind my socket, and begin listening on it. | |
Stop accepting connections on this port. | |
Inherited from BasePort | |
Raises a RuntimeError | |
Inherited from FileDescriptor | |
Called after a loseConnection(), when all data has been written. | |
File Descriptor number for select(). | |
| |
Register to receive data from a producer. | |
| |
Start waiting for read availability. | |
Start waiting for write availability. | |
Stop consuming data. | |
| |
Stop waiting for read availability. | |
Stop waiting for write availability. | |
Stop consuming data from a producer, without disconnecting. | |
Reliably write some data. | |
| |
Write as much as possible of the given data, immediately. | |
Inherited from Ephemeral | |
| |
|
Class Variable Summary | |
---|---|
int |
addressFamily = 2 |
int |
backlog = 5 |
str |
interface = ''
|
int |
sessionno = 0 |
int |
socketType = 1 |
class |
transport = twisted.internet.tcp.Server |
Inherited from FileDescriptor | |
tuple |
__implements__ = (<class twisted.internet.interfaces.IPr...
|
int |
bufferSize = 65536 |
int |
connected = 0 |
str |
dataBuffer = ''
|
int |
disconnected = 0 |
int |
disconnecting = 0 |
int |
offset = 0 |
NoneType |
producer = None |
int |
producerPaused = 0 |
int |
streamingProducer = 0 |
Method Details |
---|
__init__(self,
port,
factory,
backlog=5,
interface='',
reactor=None)
Initialize with a numeric port to listen on.
|
connectionLost(self, reason)Cleans up my socket. |
doRead(self)Called when my socket is ready for reading. This accepts a connection and calls self.protocol() to handle the wire-level protocol. |
getHost(self)Returns an IPv4Address. This indicates the server's address. |
logPrefix(self)Returns the name of my class, to prefix log entries with.
|
loseConnection(self, connDone=<twisted.python.failure.Failure twisted.internet.error.Co...)Stop accepting connections on this port. This will shut down my socket and call self.connectionLost(). It returns a deferred which will fire successfully when the port is actually closed. |
startListening(self)Create and bind my socket, and begin listening on it. This is called on unserialization, and must be called after creating a server to begin listening on the specified port. |
stopListening(self, connDone=<twisted.python.failure.Failure twisted.internet.error.Co...)Stop accepting connections on this port. This will shut down my socket and call self.connectionLost(). It returns a deferred which will fire successfully when the port is actually closed. |
Class Variable Details |
---|
addressFamily
|
backlog
|
interface
|
sessionno
|
socketType
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:49 2004 | http://epydoc.sf.net |