Protocol

Handles the nitty-gritty details of sending and recieving requests and responses across a communication protocol.

Since protocols must be unpickleable, there may be multiple instances of the same protocol object. Therefore, there should generally be some object that the protocol can locate within its setattr method that actually houses the single instance of the connection that the multiple protocol objects refer to.

Base Classes

Methods

getNext(self)

   def getNext(self):

Derived classes must implement this to get the next object received on the protocol. Should return None if the connection closes.

getProtocolId(self)

   def getProtocolId(self):

Derived classes must use implement this to return a unique protocol id. Protocol ids should be strings beginning with a type identifier followed by a colon (e.g. "tcp:") and followed by a value that uniquely identifies the connection.

send(self, msg)

   def send(self, msg):

Sends a request or response message through the protocol.