Package g4ds :: Package protocols :: Module tcpsocketprotocol :: Class ProtocolImplementation
[show private | hide private]
[frames | no frames]

Class ProtocolImplementation

ProtocolInterface --+
                    |
                   ProtocolImplementation


Protocol implementation for G4DS for simple TCP socket connections.
Method Summary
  __init__(self)
Call super constructor and initialise with name.
  listen(self, callback)
Initialises the TCP socket.
Boolean sendMessage(self, endpoint, message)
Send a message to the endpoint given.
  shutdown(self)
Stop listening.
  _waitForMessages(self)
Sends each incoming message to the callback.
Inherited from ProtocolInterface: getName

Instance Variable Summary
Function _callback: Function to call whenever a new message arrives
socket.socket _server: TCP server instance used for listening.
Inherited from ProtocolInterface: _name

Method Details

__init__(self)
(Constructor)

Call super constructor and initialise with name.
Overrides:
g4ds.protocols.protocolinterface.ProtocolInterface.__init__

listen(self, callback)

Initialises the TCP socket.

Parameters are loaded from the config module.
Overrides:
g4ds.protocols.protocolinterface.ProtocolInterface.listen

sendMessage(self, endpoint, message)

Send a message to the endpoint given.
Returns:
Indicates, whether the message was send sucessfully
           (type=Boolean)
Overrides:
g4ds.protocols.protocolinterface.ProtocolInterface.sendMessage

shutdown(self)

Stop listening.
Overrides:
g4ds.protocols.protocolinterface.ProtocolInterface.shutdown

_waitForMessages(self)

Sends each incoming message to the callback.

Instance Variable Details

_callback

Function to call whenever a new message arrives
Type:
Function

_server

TCP server instance used for listening.
Type:
socket.socket

Generated by Epydoc 2.0 on Sat Oct 22 22:52:47 2005 http://epydoc.sf.net