Package roslib :: Module xmlrpc :: Class XmlRpcNode
[frames] | no frames]

Class XmlRpcNode

source code

object --+
         |
        XmlRpcNode

Generic XML-RPC node. Handles the additional complexity of binding an XML-RPC server to an arbitrary port. XmlRpcNode is initialized when the uri field has a value.

Instance Methods
 
__init__(self, port=0, rpc_handler=None, on_run_error=None)
XML RPC Node constructor
source code
 
shutdown(self, reason)
Terminate i/o connections for this server.
source code
 
start(self)
Initiate a thread to run the XML RPC server.
source code
 
set_uri(self, uri)
Sets the XML-RPC URI.
source code
 
run(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, port=0, rpc_handler=None, on_run_error=None)
(Constructor)

source code 

XML RPC Node constructor

Parameters:
  • port (int) - port to use for starting XML-RPC API. Set to 0 or omit to bind to any available port.
  • rpc_handler (XmlRpcHandler) - XML-RPC API handler for node.
  • on_run_error (fn(Exception)) - function to invoke if server.run() throws Exception. Server always terminates if run() throws, but this enables cleanup routines to be invoked if server goes down, as well as include additional debugging.
Overrides: object.__init__

shutdown(self, reason)

source code 

Terminate i/o connections for this server.

Parameters:
  • reason (str) - human-readable debug string

start(self)

source code 

Initiate a thread to run the XML RPC server. Uses thread.start_new_thread.

set_uri(self, uri)

source code 

Sets the XML-RPC URI. Defined as a separate method as a hood for subclasses to bootstrap initialization. Should not be called externally.

Parameters:
  • uri (str) - XMLRPC URI.