liubao68 commented on a change in pull request #1827:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/1827#discussion_r439161786
##########
File path:
service-registry/registry-zero-config/src/main/java/org/apache/servicecomb/zeroconfig/server/ServerUtil.java
##########
@@ -172,16 +172,29 @@ private static ServerMicroserviceInstance
buildServerMicroserviceInstanceFromMap
return map;
}
+ private static void initMulticastSocket() throws IOException {
+ multicastSocket = new MulticastSocket(PORT);
+ group = InetAddress.getByName(GROUP);
+ multicastSocket.joinGroup(group); // need to join the group to be able to
receive the data
+ }
+
private static void startListenerForRegisterUnregisterEvent() {
try {
byte[] buffer = new byte[DATA_PACKET_BUFFER_SIZE];
Review comment:
cyclomatic complexity of `startListenerForRegisterUnregisterEvent` is a
bit too high, can be refactored.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]