Package rospy :: Package impl :: Module tcpros_service :: Class ServiceImpl

Class ServiceImpl

source code

      object --+    
               |    
service._Service --+
                   |
                  ServiceImpl
Known Subclasses:

Implementation of ROS Service. This intermediary class allows for more configuration of behavior than the Service class.

Instance Methods
 
__init__(self, name, service_class, handler, buff_size=65536, error_handler=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
error_handler(self, e, exc_type, exc_value, tb) source code
 
shutdown(self, reason='')
Stop this service
source code
 
spin(self)
Let service run and take over thread until service or node shutdown.
source code
 
handle(self, transport, header)
Process incoming request.
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, name, service_class, handler, buff_size=65536, error_handler=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

shutdown(self, reason='')

source code 

Stop this service

Parameters:
  • reason (str) - human-readable shutdown reason

spin(self)

source code 

Let service run and take over thread until service or node shutdown. Use this method to keep your scripts from exiting execution.

handle(self, transport, header)

source code 

Process incoming request. This method should be run in its own thread. If header['persistent'] is set to 1, method will block until connection is broken.

Parameters:
  • transport (TCPROSTransport) - transport instance
  • header (dict) - headers from client