Socket.connect() to 0.0.0.0: Windows vs. Mac
Imagine the following code: String hostName = "0.0.0.0"; int port = 10002; int timeout = 5000; Socket socket = new Socket(); socket.connect(new InetSocketAddress(hostName, port), timeout); On the Mac it works fine and executes the connect (even with nothing running on port 10002) and on Windows I get the following exception: java.net.SocketException: Permission denied: connect What's the difference here and what would be the alternative on Windows? This is used in unit tests. Regards Jonas ariganis Just in case somebody else stumbles upon this question, I am answering it. Unfortunately,