Package rospy :: Package impl :: Module udpros :: Class UDPROSHandler

Class UDPROSHandler

source code

transport.ProtocolHandler --+
                            |
                           UDPROSHandler

rospy protocol handler for UDPROS. Stores the datagram server if necessary.

Instance Methods
 
__init__(self, port=0)
ctor
source code
 
init_server(self)
Initialize and start the server thread, if not already initialized.
source code
 
run(self) source code
 
shutdown(self) source code
(int, str, int)
create_transport(self, topic_name, pub_uri, protocol_params)
Connect to topic resolved_name on Publisher pub_uri using UDPROS.
source code
bool
supports(self, protocol)
Returns: True if protocol is supported
source code
 
get_supported(self)
Get supported protocols
source code
(int, str, list)
init_publisher(self, topic_name, protocol_params)
Initialize this node to start publishing to a new UDP location.
source code
str
topic_connection_handler(self, sock, client_addr, header)
Process incoming topic connection.
source code
Method Details

create_transport(self, topic_name, pub_uri, protocol_params)

source code 

Connect to topic resolved_name on Publisher pub_uri using UDPROS.

Parameters:
  • resolved_name (str), str - resolved topic name
  • pub_uri (str) - XML-RPC URI of publisher
  • protocol_params ([XmlRpcLegal]) - protocol parameters to use for connecting
Returns: (int, str, int)
code, message, debug

supports(self, protocol)

source code 
Parameters:
  • protocol (str) - name of protocol
Returns: bool
True if protocol is supported

init_publisher(self, topic_name, protocol_params)

source code 

Initialize this node to start publishing to a new UDP location.

Parameters:
  • resolved_name - topic name
  • protocol_params ([str, value*]) - requested protocol parameters. protocol[0] must be the string 'UDPROS'
  • resolved__name (str)
Returns: (int, str, list)
(code, msg, [UDPROS, addr, port])

topic_connection_handler(self, sock, client_addr, header)

source code 

Process incoming topic connection. Reads in topic name from handshake and creates the appropriate TCPROSPub handler for the connection.

Parameters:
  • sock (socket.socket) - socket connection
  • client_addr ((str, int)) - client address
  • header (dict) - key/value pairs from handshake header
Returns: str
error string or None