andvasp commented on code in PR #2674:
URL: https://github.com/apache/plc4x/pull/2674#discussion_r3754121998


##########
plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/base/EipTcpConnection.java:
##########
@@ -280,6 +278,48 @@ private CompletableFuture<Void> probeAttributes() {
         });
     }
 
+    private CipService getCipService(EipPacket response) {
+        if (response instanceof CipRRData rr
+            && rr.getStatus() == CIPStatus.Success.getValue()
+            && rr.getTypeIds().size() > 1
+            && rr.getTypeIds().get(1) instanceof UnConnectedDataItem di) {
+            return di.getService();
+        }
+        return null;
+    }
+
+    private CompletableFuture<Void> 
probeAttributesUsingSingleAttributeRequest() {
+        LOGGER.debug("Checking MessageRouter and ConnectionManager using 
GetAttributeSingle");
+
+        return 
checkAttributeSupport(CIPClassID.ConnectionManager).thenCompose(hasSupport -> {
+            useConnectionManager = hasSupport;
+            return checkAttributeSupport(CIPClassID.MessageRouter);
+        }).thenAccept(hasSupport -> {
+            useMessageRouter = hasSupport;
+        });
+    }

Review Comment:
   If we can check that the connection manager is available and an error 
happens while checking for message router support, I believe we should keep the 
connection manager as available and not fallback to unconnected code path. This 
way we would just update the comments on the exceptionally block.
   
   What do you think @chrisdutz ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to