Question

So I've been working on a small application that would allow me to create a server, have the server connect/bind to a hamachi network/port, and allow the client to join the hamachi server, then use the client application to communicate and other such things over the server.

There is no good documentation that I've been able to find in the last 4 hours that specifies how to do this. I have a basic Server application that works fine on the "localhost", but I really want to make it work over hamachi.

code example:

        InetAddress addr = InetAddress.getByName("**.***.***.***");
        ServerSocket sSocket = new ServerSocket(****, 5, addr);

The error received is:

Error: java.net.BindException: Cannot assign requested address: JVM_Bind

I am using netbeans, and yes, I am 100% positive that the port is NOT in use. Please help!

Was it helpful?

Solution

Just specify null as the third argument to the constructor. That means 'listen at all local IP addresses'.

I suspect the IP address you're trying to bind to isn't local. You can't do that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top