class TCPROSTransport(Transport):
Constructor: TCPROSTransport(protocol, name, header)
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 |
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 |
Read TCPROS header from active socket @raise TransportInitError if header fails to validate |
Method | receive |
Receive messages until shutdown @param msgs_callback: callback to invoke for new messages received @type msgs_callback: fn([msg]) |
Method | receive |
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 |
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 |
Set the endpoint_id of this transport. Allows the endpoint_id to be set before the socket is initialized. |
Method | set |
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 |
Write raw data to transport @raise TransportInitialiationError: could not be initialized @raise TransportTerminated: no longer open for publishing |
Method | write |
Writes the TCPROS header to the active connection. |
Class Variable | transport |
Undocumented |
Instance Variable | callerid |
Undocumented |
Instance Variable | dest |
Undocumented |
Instance Variable | endpoint |
Undocumented |
Instance Variable | header |
Undocumented |
Instance Variable | is |
Undocumented |
Instance Variable | latch |
Undocumented |
Instance Variable | local |
Undocumented |
Instance Variable | md5sum |
Undocumented |
Instance Variable | protocol |
Undocumented |
Instance Variable | read |
Undocumented |
Instance Variable | remote |
Undocumented |
Instance Variable | socket |
Undocumented |
Instance Variable | type |
Undocumented |
Instance Variable | write |
Undocumented |
Method | _reconnect |
Undocumented |
Method | _validate |
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 |
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
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
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]
Receive messages until shutdown @param msgs_callback: callback to invoke for new messages received @type msgs_callback: fn([msg])
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
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
Set the endpoint_id of this transport. Allows the endpoint_id to be set before the socket is initialized.
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
Write raw data to transport @raise TransportInitialiationError: could not be initialized @raise TransportTerminated: no longer open for publishing