aaron-ai commented on PR #5000:
URL: https://github.com/apache/rocketmq/pull/5000#issuecomment-1236544621

   > > 细节
   > 
   > Hi, do you mean to apply for a free available port as follows:
   > 
   > ```
   >             ServerSocket serverSocket = new ServerSocket(0);
   >             int port = serverSocket.getLocalPort();
   > ```
   
   Thank you for contributing!
   
   It seems that the only way to find an available port is try to occupy a port 
using 0 and release it, but this approach is not thread-safe. You could get 
more information from the [deprecation of 
SocketUtils#findAvailableTcpPort](https://github.com/spring-projects/spring-framework/issues/28052)


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