AlbumenJ commented on issue #10889:
URL: https://github.com/apache/dubbo/issues/10889#issuecomment-1306396638

   ```java
   public static synchronized int getAvailablePort(int port) {
           if (port < MIN_PORT) {
               return MIN_PORT;
           }
   
           for (int i = port; i < MAX_PORT; i++) {
               if (USED_PORT.get(i)) {
                   continue;
               }
               try (ServerSocket ignored = new ServerSocket(i)) {
                   USED_PORT.set(i);
                   port = i;
                   break;
               } catch (IOException e) {
                   // continue
               }
           }
           return port;
       }
   ```
   这段代码逻辑你自己写个 demo 跑一下看看 IOException 是不是有东西,可能是环境配置的问题


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