From db63e67a361ef195503d6145d19703b740e2a6af Mon Sep 17 00:00:00 2001 From: neocoretechs Date: Wed, 23 Dec 2020 05:53:38 -0800 Subject: [PATCH] Fixed proper response to ServiceServer not running, No such service from remote client. --- .../org/ros/internal/node/rpc/MasterRpcEndpointImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/ros/internal/node/rpc/MasterRpcEndpointImpl.java b/src/main/java/org/ros/internal/node/rpc/MasterRpcEndpointImpl.java index 6945b48..05c80dc 100644 --- a/src/main/java/org/ros/internal/node/rpc/MasterRpcEndpointImpl.java +++ b/src/main/java/org/ros/internal/node/rpc/MasterRpcEndpointImpl.java @@ -143,14 +143,15 @@ public List unregisterSubscriber(String callerId, String topicName, Stri @Override public List 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