How to find an available port?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-04-20T13:16:08Z Indexed on 2010/04/20 13:23 UTC
Read the original article Hit count: 333

Filed under:
|
|
|

I want to start a server which listen to a port. I can specify port explicitly and it works. But I would like to find a port in an automatic way. In this respect I have two questions.

  1. In which range of port numbers should I search for? (I used ports 12345, 12346, and 12347 and it was fine).

  2. How can I find out if a given port is not occupied by another software?

© Stack Overflow or respective owner

Related posts about java

Related posts about port