Is there an easy way to make sure that the local port is not open yet. Some TCP socket servers (such as Grizzly) do not seem to perform this check by default. When this check is missing, the server starts to start and respond, but the client code simply connects to the old server, which was not turned off. It can be very bad!
Is there a simple line of Java code that can verify that a port is not yet in use by another process?
User1 source
share