Skip to content

Commit

Permalink
Fixed proper response to ServiceServer not running, No such service f…
Browse files Browse the repository at this point in the history
…rom remote client.
  • Loading branch information
neocoretechs committed Dec 23, 2020
1 parent 3fb5a3c commit db63e67
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ public List<Object> unregisterSubscriber(String callerId, String topicName, Stri

@Override
public List<Object> lookupService(String callerId, String serviceName) {
RemoteRequestInterface rri = new RemoteRequest("org.ros.internal.node.server.master.MasterServer",
RemoteRequestInterface rri = new RemoteRequest("org.ros.internal.node.server.master.MasterServer",
"lookupService",
GraphName.of(serviceName));
InetSocketAddress slaveUri = (InetSocketAddress) remoteMaster.queue(rri);//master.lookupService(GraphName.of(serviceName));
if (slaveUri != null) {
Object sock = remoteMaster.queue(rri);//master.lookupService(GraphName.of(serviceName));
if (sock != null && sock instanceof InetSocketAddress) {
InetSocketAddress slaveUri = (InetSocketAddress)sock;
return Response.newSuccess("Success", slaveUri.toString()).toList();
}
return Response.newError("No such service.", null).toList();
return Response.newError("No such service.", callerId+" "+serviceName).toList();
}

@Override
Expand Down

0 comments on commit db63e67

Please sign in to comment.