Atlas 0.7.0
Networking protocol for the Worldforge system.
atlas.transport.bridge.Bridge Class Reference

Public Member Functions

def __init__ (self, negotiation=NegotiationClient, store_operations=1, functions=None)
 
def send_string (self, data)
 
def operation_received (self, op)
 
def connection_ok (self)
 
def log (self, type, data)
 
def setup (self)
 
def close (self)
 
def process_string (self, data)
 
def process_operation (self, op=None)
 
def internal_send_string (self, data)
 
def decode_string (self, data)
 

Public Attributes

 codec
 
 negotiation
 
 store_operations
 
 operations_to_send
 
 send_string
 
 operation_received
 
 connection_ok
 
 log
 

Detailed Description

includes negotiation at start and codecs when sending/receiving
   translation from Object to string: return string to be transmitted
      (or at begin negotiation strings)
   transltaion from string to Object: return Object received
      (or at begin nothing until negotiation done)
   raise bridge error on negotiation (TODO: or syntax error in encoding)
   operations send before codec if negotiated is either stored to queue or discarded

   Usage: replace send_string, operation_received, connection_ok, log
          with your own functions/methods
   Process incoming strings with process_string method:
          returns string to send, operations received
          (also calls 'Usage: methods' as needed)
   Process outgoing operations with process_operation:
          returns string to send
          (also calls 'Usage: methods' as needed)

Definition at line 28 of file bridge.py.

Constructor & Destructor Documentation

◆ __init__()

def atlas.transport.bridge.Bridge.__init__ (   self,
  negotiation = NegotiationClient,
  store_operations = 1,
  functions = None 
)

Definition at line 46 of file bridge.py.

Member Function Documentation

◆ close()

def atlas.transport.bridge.Bridge.close (   self)

Definition at line 87 of file bridge.py.

◆ connection_ok()

def atlas.transport.bridge.Bridge.connection_ok (   self)
this is called after negotiation is done

Definition at line 72 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ decode_string()

def atlas.transport.bridge.Bridge.decode_string (   self,
  data 
)

Definition at line 137 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ internal_send_string()

def atlas.transport.bridge.Bridge.internal_send_string (   self,
  data 
)

Definition at line 131 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ log()

◆ operation_received()

def atlas.transport.bridge.Bridge.operation_received (   self,
  op 
)
this is called for eac decoded operation

Definition at line 67 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ process_operation()

def atlas.transport.bridge.Bridge.process_operation (   self,
  op = None 
)

Definition at line 115 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ process_string()

def atlas.transport.bridge.Bridge.process_string (   self,
  data 
)

Definition at line 91 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ send_string()

def atlas.transport.bridge.Bridge.send_string (   self,
  data 
)
send string using transport specific method: specify your own

Definition at line 62 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ setup()

def atlas.transport.bridge.Bridge.setup (   self)

Member Data Documentation

◆ codec

atlas.transport.bridge.Bridge.codec

Definition at line 47 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ connection_ok

atlas.transport.bridge.Bridge.connection_ok

Definition at line 57 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ log

atlas.transport.bridge.Bridge.log

Definition at line 59 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ negotiation

atlas.transport.bridge.Bridge.negotiation

Definition at line 48 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ operation_received

atlas.transport.bridge.Bridge.operation_received

Definition at line 55 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ operations_to_send

atlas.transport.bridge.Bridge.operations_to_send

Definition at line 50 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ send_string

atlas.transport.bridge.Bridge.send_string

Definition at line 53 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().

◆ store_operations

atlas.transport.bridge.Bridge.store_operations

Definition at line 49 of file bridge.py.

Referenced by atlas.transport.bridge.Bridge.log().


The documentation for this class was generated from the following file: