Table of Contents

Class: ITransport Twisted-0.19.0/twisted/internet/interfaces.py

I am a transport for bytes.

I represent (and wrap) the physical connection and synchronicity of the framework which is talking to the network. I make no representations about whether calls to me will happen immediately or require returning to a control loop, or whether they will happen in the same or another thread. Consider methods of this class (aside from getPeer) to be thrown over the wall, to happen at some indeterminate time.

Base Classes   
Interface
Methods   
getHost
getPeer
loseConnection
write
  getHost 
getHost ( self )

Similar to getPeer, but returns a tuple describing this side of the connection.

  getPeer 
getPeer ( self )

Return a tuple of (TYPE, ...).

This indicates the other end of the connection. TYPE indicates what sort of connection this is: "INET", "UNIX", or something else. "INET" tuples have 2 additional elements; hostname and port.

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, etcetera.

  loseConnection 
loseConnection ( self )

Close my connection, after writing all pending data.

  write 
write ( self,  data )

Write some data to the physical connection, in sequence.

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.


Table of Contents

This document was automatically generated on Sun Jul 14 19:52:41 2002 by HappyDoc version 2.0