ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can multiple clients communicate with the server at the same time?

asked 2016-06-29 04:16:43 -0500

Pikachu gravatar image

I have already established a client and a server connection. Now I need to have multiple clients all calling for the same service. How can I achieve this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-06-29 10:25:52 -0500

There can only be a single server providing a service using a given graph resource name. That server can have an unlimited number of clients. The clients can be distributed amongst different nodes or in the same node. The clients can all have individual settings for persistence.

All you need to achieve this is to create additional rospy.ServiceProxy() objects or ros::ServiceClient objects.

Note that the client library (rospy vs. roscpp) used for the service server will define exactly how client requests are queued/ handled. The rospy docs say " Each inbound request is handled in its own thread, so services must be thread-safe." In roscpp, services are handled with callback queues and spinning (just like topics).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-06-29 04:16:43 -0500

Seen: 2,767 times

Last updated: Jun 29 '16