|
Atlas
0.7.0
Networking protocol for the Worldforge system.
|
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 | |
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)
| 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().
| def atlas.transport.bridge.Bridge.log | ( | self, | |
| type, | |||
| data | |||
| ) |
various debug things
Definition at line 77 of file bridge.py.
References atlas.transport.bridge.Bridge.codec, atlas.transport.bridge.Bridge.connection_ok, test_bridge.Common.connection_ok(), atlas.transport.bridge.Bridge.decode_string(), atlas.transport.bridge.Bridge.internal_send_string(), atlas.transport.bridge.Bridge.log, test_bridge.Common.log(), atlas.transport.bridge.Bridge.negotiation, atlas.transport.bridge.Bridge.operation_received, atlas.transport.file.File.operation_received(), test_bridge.Common.operation_received(), atlas.transport.bridge.Bridge.operations_to_send, atlas.transport.bridge.Bridge.process_operation(), atlas.transport.bridge.Bridge.process_string(), atlas.transport.bridge.Bridge.send_string, test_bridge.Common.send_string(), atlas.transport.file.File.send_string(), and atlas.transport.bridge.Bridge.store_operations.
Referenced by atlas.transport.bridge.Bridge.log().
| 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().
| 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().