Public Member Functions | |
def | __init__ |
def | get_socket |
def | close |
def | send_req |
def | read_req |
def | rpc |
def | send_error |
def | send_resp |
def | read_resp |
Data Fields | |
s | |
Static Public Attributes | |
int | HDR_LEN = 10 |
Provides wire serialization by using json. Loosely conforms to json-rpc, however a length header was added so that we would have the ability to use non sax like json parsers, which are more abundant. <Zero padded 10 digit number [1..2**32] for the length followed by valid json. Notes: id field (json-rpc) is present but currently not being used. This is available to be expanded on later.
Definition at line 28 of file _transport.py.
def __init__ | ( | self, | ||
socket_descriptor | ||||
) |
Definition at line 91 of file _transport.py.
def close | ( | self | ) |
Closes the transport and the underlying socket
Definition at line 118 of file _transport.py.
def get_socket | ( | path | ) |
Returns a connected socket from the passed in path.
Definition at line 95 of file _transport.py.
def read_req | ( | self | ) |
Reads a message and returns the parsed version of it.
Definition at line 139 of file _transport.py.
def read_resp | ( | self | ) |
Definition at line 172 of file _transport.py.
def rpc | ( | self, | ||
method, | ||||
args | ||||
) |
Sends a request and waits for a response.
Definition at line 148 of file _transport.py.
def send_error | ( | self, | ||
msg_id, | ||||
error_code, | ||||
msg, | ||||
data = None | ||||
) |
Used to transmit an error.
Definition at line 157 of file _transport.py.
def send_req | ( | self, | ||
method, | ||||
args | ||||
) |
Sends a request given a method and arguments. Note: arguments must be in the form that can be automatically serialized to json
Definition at line 124 of file _transport.py.
def send_resp | ( | self, | ||
result, | ||||
msg_id = 100 | ||||
) |
Used to transmit a response
Definition at line 165 of file _transport.py.
int HDR_LEN = 10 [static] |
Definition at line 42 of file _transport.py.
Definition at line 92 of file _transport.py.