Package twisted :: Package internet :: Module interfaces :: Class ITransport
[show private | hide private]
[frames | no frames]

Type ITransport

object --+    
         |    
 Interface --+
             |
            ITransport


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.
Method Summary
  getHost(self)
Similar to getPeer, but returns an address describing this side of the connection.
  getPeer(self)
Return an IAddress.
  loseConnection(self)
Close my connection, after writing all pending data.
  write(self, data)
Write some data to the physical connection, in sequence.
  writeSequence(self, data)
Write a list of strings to the physical connection.
    Inherited from Interface
  adaptWith(self, using, to, registry)
(Class method)
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Method Details

getHost(self)

Similar to getPeer, but returns an address describing this side of the connection.

getPeer(self)

Return an IAddress.

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(self)

Close my connection, after writing all pending data.

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.

writeSequence(self, data)

Write a list of strings to the physical connection.

If possible, make sure that all of the data is written to the socket at once, without first copying it all into a single string.

Generated by Epydoc 2.1 on Tue Aug 17 17:08:19 2004 http://epydoc.sf.net