Ambiguity: Establishing a service connection

asked 2015-02-08 12:55:30 -0500

Anton Belev gravatar image

updated 2015-02-10 06:34:56 -0500

I'm reading through this tutorial . Section 7 is saying the following:

The most recent node to register with the master is considered the current service provider.

Say now we have:

  1. Node A, which is service provider for service "add_two_ints", registers with Master.
  2. Node C, which is client to the "add_two_ints" service registers with the Master.
  3. Node C sends request
  4. Node A sends response
  5. Node B, which is service provider for service "add_two_ints", registers with Master.
  6. Node C sends request

In that situation how does the Master hooks up Node C to Node A after point 2? Does the Master maintain a table with the lastly registered nodes which a provider to a service? The citation above is quite unclear, at first I assumed that at a given point there can be only one service provider (to any service) <- The latter not correct, right?

At point 6, where will Node C get the response from - node A or node B? (assuming that the connection is not persistent). Here I assume that the response will come from A, am I correct?

Then subsection 7.1, which is about persistent connections to service is saying:

Greater care should be used with persistent connections. If a new service provider appears, it does not interrupt an ongoing connection. Similarly, if a persistent connection fails, there is no attempt made to reconnect.

Considering the last citation - at point 6, where will Node C get the response from - node A or node B? (assuming that the connection is persistent). Here I assume that C will get a response from A, am I correct?

I'm doing a model checking on ROS, that's why I'm asking such a detailed questions. The most important question here for me is how actually the Master hooks up the server to client and what will the Master do, if the client registers first (the wait_for_service function) and then a provider registers.

Again sorry for asking more than one question, but it's all about how the client service communication is established. Partial answers are acceptable as well. Much appreciated!!!

edit retag flag offensive close merge delete

Comments

Anyone any ideas?

Anton Belev gravatar image Anton Belev  ( 2015-02-11 12:42:48 -0500 )edit