Package spoon :: Package transports :: Module SpoonTransport :: Class SpoonTransport
[show private | hide private]
[frames | no frames]

Type SpoonTransport

object --+
         |
        SpoonTransport


The spoon transport base class. This will probably mostly be responsible for handling locking on the transport. It also takes care of removing itself from the transport hub if it is made inactive.

Any reads or writes on the socket should be performed with the SpoonTransport, or otherwise synchronized once this is created.
Method Summary
  __init__(self, t, network)
Creates a spoon transport link out of an existing socket and joins it to a network.
  __get_active(self)
  __repr__(self)
  __set_active(self, newval)
  close(self)
  fileno(self)
Returns the fileno for use in a select or poll call if one exists for the socket or file wrapped by this SpoonTransport.
  getAuthedNodeId(self)
override this if your class does any pre authentication.
  getNetwork(self)
  read(self)
  start(self)
Starts the spoon protocol on the socket.
  write(self, obj)
    Inherited from object
  __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
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
  active: Indicates if the transport is currently active.
  sock: The raw socket or file object that the transport is bound to
  spoon: The SpoonStream wrapper around the socket.

Method Details

__init__(self, t, network=None)
(Constructor)

Creates a spoon transport link out of an existing socket and joins it to a network. This network is either a mesh network or a point to point network (just a direct connection.)
Parameters:
t - Some sort of a socket or file like object.
network - An instance of a mesh network or a point to point network that the transport will be joined to.
Overrides:
__builtin__.object.__init__

fileno(self)

Returns the fileno for use in a select or poll call if one exists for the socket or file wrapped by this SpoonTransport. If the socket or file does not have a fileno method, None will be returned. For proper behavior with paramiko, fileno on the socket isn't called any time before fileno is called on the SpoonTransport.

getAuthedNodeId(self)

override this if your class does any pre authentication.

start(self)

Starts the spoon protocol on the socket. Must be called before writing/reading with the SpoonTransport object. Will cause the Transport to be registered with TransportHub.

Instance Variable Details

active

Indicates if the transport is currently active.

sock

The raw socket or file object that the transport is bound to

spoon

The SpoonStream wrapper around the socket.

Generated by Epydoc 2.1 on Sun Nov 26 15:33:58 2006 http://epydoc.sf.net