class documentation

class TCPROSTransport(Transport):

Constructor: TCPROSTransport(protocol, name, header)

View In Hierarchy

Generic implementation of TCPROS exchange routines for both topics and services

Method __init__ ctor @param name str: identifier @param protocol TCPROSTransportProtocol protocol implementation @param header dict: (optional) handshake header if transport handshake header was already read off of transport...
Method close close i/o and release resources
Method connect Establish TCP connection to the specified address/port. connect() always calls L{write_header()} and L{read_header()} after the connection is made @param dest_addr: destination IP address @type dest_addr: str @param dest_port: destination port @type dest_port: int @param endpoint_id: string identifier for connection (for statistics) @type endpoint_id: str @param timeout: (optional keyword) timeout in seconds @type timeout: float @raise TransportInitError: if unable to create connection...
Method fileno Get descriptor for select
Method get_transport_info Get detailed connection information. Similar to getTransportInfo() in 'libros/transport/transport_tcp.cpp' e.g. TCPROS connection on port 41374 to [127.0.0.1:40623 on socket 6]
Method read_header Read TCPROS header from active socket @raise TransportInitError if header fails to validate
Method receive_loop Receive messages until shutdown @param msgs_callback: callback to invoke for new messages received @type msgs_callback: fn([msg])
Method receive_once block until messages are read off of socket @return: list of newly received messages @rtype: [Msg] @raise TransportException: if unable to receive message due to error
Method send_message Convenience routine for services to send a message across a particular connection. NOTE: write_data is much more efficient if same message is being sent to multiple connections. Not threadsafe. @param msg: message to send @type msg: Msg @param seq: sequence number for message @type seq: int @raise TransportException: if error occurred sending message...
Method set_endpoint_id Set the endpoint_id of this transport. Allows the endpoint_id to be set before the socket is initialized.
Method set_socket Set the socket for this transport @param sock: socket @type sock: socket.socket @param endpoint_id: identifier for connection endpoint @type endpoint_id: str @raise TransportInitError: if socket has already been set...
Method write_data Write raw data to transport @raise TransportInitialiationError: could not be initialized @raise TransportTerminated: no longer open for publishing
Method write_header Writes the TCPROS header to the active connection.
Class Variable transport_type Undocumented
Instance Variable callerid_pub Undocumented
Instance Variable dest_address Undocumented
Instance Variable endpoint_id Undocumented
Instance Variable header Undocumented
Instance Variable is_latched Undocumented
Instance Variable latch Undocumented
Instance Variable local_endpoint Undocumented
Instance Variable md5sum Undocumented
Instance Variable protocol Undocumented
Instance Variable read_buff Undocumented
Instance Variable remote_endpoint Undocumented
Instance Variable socket Undocumented
Instance Variable type Undocumented
Instance Variable write_buff Undocumented
Method _reconnect Undocumented
Method _validate_header Validate header and initialize fields accordingly @param header: header fields from publisher @type header: dict @raise TransportInitError: if header fails to validate
Instance Variable _fileno Undocumented
def __init__(self, protocol, name, header=None):

ctor @param name str: identifier @param protocol TCPROSTransportProtocol protocol implementation @param header dict: (optional) handshake header if transport handshake header was already read off of transport. @raise TransportInitError if transport cannot be initialized according to arguments

def close(self):

close i/o and release resources

def connect(self, dest_addr, dest_port, endpoint_id, timeout=None):

Establish TCP connection to the specified address/port. connect() always calls L{write_header()} and L{read_header()} after the connection is made @param dest_addr: destination IP address @type dest_addr: str @param dest_port: destination port @type dest_port: int @param endpoint_id: string identifier for connection (for statistics) @type endpoint_id: str @param timeout: (optional keyword) timeout in seconds @type timeout: float @raise TransportInitError: if unable to create connection

def fileno(self):

Get descriptor for select

def get_transport_info(self):

Get detailed connection information. Similar to getTransportInfo() in 'libros/transport/transport_tcp.cpp' e.g. TCPROS connection on port 41374 to [127.0.0.1:40623 on socket 6]

def read_header(self):

Read TCPROS header from active socket @raise TransportInitError if header fails to validate

def receive_loop(self, msgs_callback):

Receive messages until shutdown @param msgs_callback: callback to invoke for new messages received @type msgs_callback: fn([msg])

def receive_once(self):

block until messages are read off of socket @return: list of newly received messages @rtype: [Msg] @raise TransportException: if unable to receive message due to error

def send_message(self, msg, seq):

Convenience routine for services to send a message across a particular connection. NOTE: write_data is much more efficient if same message is being sent to multiple connections. Not threadsafe. @param msg: message to send @type msg: Msg @param seq: sequence number for message @type seq: int @raise TransportException: if error occurred sending message

def set_endpoint_id(self, endpoint_id):

Set the endpoint_id of this transport. Allows the endpoint_id to be set before the socket is initialized.

def set_socket(self, sock, endpoint_id):

Set the socket for this transport @param sock: socket @type sock: socket.socket @param endpoint_id: identifier for connection endpoint @type endpoint_id: str @raise TransportInitError: if socket has already been set

def write_data(self, data):

Write raw data to transport @raise TransportInitialiationError: could not be initialized @raise TransportTerminated: no longer open for publishing

def write_header(self):

Writes the TCPROS header to the active connection.

transport_type: str =

Undocumented

callerid_pub =

Undocumented

dest_address =

Undocumented

endpoint_id =

Undocumented

header =

Undocumented

is_latched: bool =

Undocumented

latch =

Undocumented

local_endpoint =

Undocumented

md5sum =

Undocumented

protocol =

Undocumented

read_buff =

Undocumented

remote_endpoint =

Undocumented

socket =

Undocumented

type =

Undocumented

write_buff =

Undocumented

def _reconnect(self):

Undocumented

def _validate_header(self, header):

Validate header and initialize fields accordingly @param header: header fields from publisher @type header: dict @raise TransportInitError: if header fails to validate

_fileno =

Undocumented