Package twisted :: Package internet :: Module tcp :: Class Server
[show private | hide private]
[frames | no frames]

Class Server

    Logger --+        
             |        
FileDescriptor --+    
                 |    
     Ephemeral --+    
                 |    
        Connection --+
                     |
                    Server

Known Subclasses:
Server

Serverside socket-stream connection class.

I am a serverside network connection transport; a socket which came from an accept() on a server.
Method Summary
  __init__(self, sock, protocol, client, server, sessionno)
Server(sock, protocol, client, server, sessionno)
  __getstate__(self)
(inherited from Ephemeral)
  __repr__(self)
A string representation of this connection.
  __setstate__(self, state)
(inherited from Ephemeral)
  connectionLost(self, reason)
See abstract.FileDescriptor.connectionLost(). (inherited from Connection)
  doRead(self)
Calls self.protocol.dataReceived with all available data. (inherited from Connection)
  doWrite(self)
Called when data is available for writing. (inherited from FileDescriptor)
  fileno(self)
File Descriptor number for select(). (inherited from FileDescriptor)
  getHost(self)
Returns a tuple of ('INET', hostname, port).
  getPeer(self)
Returns a tuple of ('INET', hostname, port), indicating the connected client's address.
  getTcpNoDelay(self)
(inherited from Connection)
  log(self, bytes)
(inherited from Logger)
  logPrefix(self)
Return the prefix to log with when I own the logging thread. (inherited from Connection)
  loseConnection(self)
Close the connection at the next available opportunity. (inherited from FileDescriptor)
  pauseProducing(self)
(inherited from FileDescriptor)
  registerProducer(self, producer, streaming)
Register to receive data from a producer. (inherited from FileDescriptor)
  resumeProducing(self)
(inherited from FileDescriptor)
  setTcpNoDelay(self, enabled)
(inherited from Connection)
  startReading(self)
Start waiting for read availability. (inherited from FileDescriptor)
  startWriting(self)
Start waiting for write availability. (inherited from FileDescriptor)
  stopConsuming(self)
Stop consuming data. (inherited from FileDescriptor)
  stopProducing(self)
(inherited from FileDescriptor)
  stopReading(self)
Stop waiting for read availability. (inherited from FileDescriptor)
  stopWriting(self)
Stop waiting for write availability. (inherited from FileDescriptor)
  unregisterProducer(self)
Stop consuming data from a producer, without disconnecting. (inherited from FileDescriptor)
  write(self, data)
Reliably write some data. (inherited from FileDescriptor)
  writeSequence(self, iovec)
(inherited from FileDescriptor)
  writeSomeData(self, data)
Connection.writeSomeData(data) -> #of bytes written | CONNECTION_LOST This writes as much data as possible to the socket and returns either the number of bytes read (which is positive) or a connection error code (which is negative) (inherited from Connection)
  _closeSocket(self)
Called to close our socket. (inherited from Connection)
  _Logger__prefix(self)
(inherited from Logger)
  _postLoseConnection(self)
Called after a loseConnection(), when all data has been written. (inherited from FileDescriptor)

Method Details

__init__(self, sock, protocol, client, server, sessionno)
(Constructor)

Server(sock, protocol, client, server, sessionno)

Initialize me with a socket, a protocol, a descriptor for my peer (a tuple of host, port describing the other end of the connection), an instance of Port, and a session number.
Overrides:
twisted.internet.tcp.Connection.__init__

__repr__(self)
(Representation operator)

A string representation of this connection.

getHost(self)

Returns a tuple of ('INET', hostname, port).

This indicates the servers address.

getPeer(self)

Returns a tuple of ('INET', hostname, port), indicating the connected client's address.

Generated by Epydoc 1.2 prerelease on Wed Jan 29 06:28:15 2003 http://epydoc.sf.net