Cannot assign requested address using ServerSocket.socketBind

As other people have pointed out, it is most likely related to another process using port 9999. On Windows, run the command:

netstat -a -n | grep "LIST"

And it should list anything there that’s hogging the port. Of course you’ll then have to go and manually kill those programs in Task Manager. If this still doesn’t work, replace the line:

serverSocket = new ServerSocket(9999);


InetAddress locIP = InetAddress.getByName("");
serverSocket = new ServerSocket(9999, 0, locIP);

Of course replace with your actual IP address, or use

Leave a Comment