Package i2p :: Module samclasses :: Class DatagramSession
[show private | hide private]
[frames | no frames]

Class DatagramSession

BaseSession --+
              |
             DatagramSession


Datagram session. All methods are blocking and threadsafe.
Method Summary
  __init__(self, name, addr, **kwargs)
  __len__(self)
Number of packets in read buffer.
  _on_DATAGRAM_RECEIVED(self, **kwargs)
Internal method, got DATAGRAM RECEIVED.
  recv(self, timeout, peek)
Get a single packet.
  send(self, s, dest)
Send packet with contents s to given destination.
    Inherited from BaseSession
  _encode_kwargs(self, **kwargs)
Internal command, encode extra kwargs for passing to SESSION CREATE.
  _hello(self)
Internal command, handshake with SAM terminal.
  _namelookup(self, name)
Internal command, does a NAMING LOOKUP query.
  _on_HELLO_REPLY(self, **kwargs)
Internal command, got HELLO REPLY.
  _on_NAMING_REPLY(self, **kwargs)
Internal command, got NAMING REPLY.
  _on_SESSION_STATUS(self, **kwargs)
Internal command, got SESSION STATUS.
  _set_properties(self)
Internal command, call at end of __init__ to set up properties.
  close(self)
Close the session.

Method Details

__len__(self)
(Length operator)

Number of packets in read buffer.

_on_DATAGRAM_RECEIVED(self, **kwargs)

Internal method, got DATAGRAM RECEIVED.

recv(self, timeout=None, peek=False)

Get a single packet. Blocks for up to timeout seconds if n > 0 and no packet is available (timeout=None means wait forever). If still no packet is available, raises BlockError or Timeout. Returns the pair (data, address). If peek is True, the data is not removed.

send(self, s, dest)

Send packet with contents s to given destination.

Generated by Epydoc 2.1 on Mon Aug 02 01:07:41 2004 http://epydoc.sf.net