Try to open a ServerSocket on the port. If you can, the port was available and you immediately close the socket again.
If you cannot, you get an exception (or an errorcode, check the API docs for ServerSocket) and you know the port is in use already.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337