PeppaO commented on code in PR #7069:
URL: https://github.com/apache/incubator-seata/pull/7069#discussion_r1898862143


##########
discovery/seata-discovery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java:
##########
@@ -276,9 +294,82 @@ private static boolean isTokenExpired() {
         return System.currentTimeMillis() >= tokenExpiredTime;
     }
 
-    private InetSocketAddress convertInetSocketAddress(Node node) {
-        Node.Endpoint endpoint = node.getTransaction();
-        return new InetSocketAddress(endpoint.getHost(), endpoint.getPort());
+    private static String selectControlEndpointStr(Node node) {
+        InetSocketAddress control = selectControlEndpoint(node);
+        return NetUtil.toStringAddress(control);
+    }
+
+    private static String selectTransactionEndpointStr(Node node) {
+        InetSocketAddress transaction = selectTransactionEndpoint( node);
+        return NetUtil.toStringAddress(transaction);
+    }
+
+    private static InetSocketAddress selectControlEndpoint(Node node) {
+        return selectEndpoint("control", node);
+    }
+
+    private static InetSocketAddress selectTransactionEndpoint(Node node) {
+        return selectEndpoint("transaction", node);
+    }
+
+    private static InetSocketAddress selectEndpoint(String type, Node node) {
+        if (StringUtils.isBlank(PREFERRED_NETWORKS)) {
+            // 采取默认的方式,直接使用node.control  node.transaction

Review Comment:
   done



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to