Package g4ds :: Package protocols :: Module protocolinterface :: Class ProtocolInterface
[show private | hide private]
[frames | no frames]

Class ProtocolInterface

Known Subclasses:
ProtocolImplementation, ProtocolImplementation

Provides a common interface for all implementations for protocols.
Method Summary
  __init__(self, name)
Just ot set up the name of the implementation.
  getName(self)
GETTER
Boolean listen(self, callback)
The implementation should listen to a certain port here.
Boolean sendMessage(self, endpoint, message)
The implementation should send the message to the endpoint.
Boolean shutdown(self)
The implementation should shut down the listener.

Instance Variable Summary
String _name: Name of the Implementation

Method Details

__init__(self, name)
(Constructor)

Just ot set up the name of the implementation.

getName(self)

GETTER

listen(self, callback)

The implementation should listen to a certain port here.

Parameters for address and the like are not required here since the implementations should load their settings from the config module.

Any implementation must run its listener in its own thread, otherwise it will block the entire application / library.
Parameters:
callback - Function to call whenever a new message arrives
           (type=Function)
Returns:
Indicates, whether the server was established sucessfully
           (type=Boolean)

sendMessage(self, endpoint, message)

The implementation should send the message to the endpoint.
Returns:
Indicates, whether the message was send sucessfully
           (type=Boolean)

shutdown(self)

The implementation should shut down the listener.
Returns:
Indicates, whether the shutdown was sucessful.
           (type=Boolean)

Instance Variable Details

_name

Name of the Implementation
Type:
String

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