kishankavala commented on PR #8312:
URL: https://github.com/apache/cloudstack/pull/8312#issuecomment-1842744873

   > > Can you create a common util similar to the following to find a free 
port:
   > > ```
   > > try (ServerSocket socket = new ServerSocket(0)) {
   > >             socket.setReuseAddress(true);
   > >             return socket.getLocalPort();
   > >         }
   > > ```
   > 
   > +1
   > 
   > btw, can we specify a port range ?
   
   There are options to specify a range, but didn't look efficient to me.
   org.springframework.util.SocketUtils#findAvailableTcpPort(int, int)
   Its deprecated as well.


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