By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,784 Members | 1,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,784 IT Pros & Developers. It's quick & easy.

Bind exception

P: n/a
eeh
Hi,

I got bind exception (Jave.ent.BindException: Cannot assign requested
address: JVM_BIND) when the following statement is executed.

ss=new ServerSocket(0x55,0,InetAddress.getByName("192.168 .0.8"));

The host 192.168.0.8 is on and can be pinged.

Could anyone tell me why?

When I change the stement to be

ss=new ServerSocket(0x55);

no exception is thrown.

Thanks!

Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
eeh wrote:
The host 192.168.0.8 is on and can be pinged.


But is it the IP address of the machine that's running the code?? It
should be...

--
Michael Banzon
http://michael.banzon.dk/
Jul 17 '05 #2

P: n/a
eeh
>
But is it the IP address of the machine that's running the code?? It
should be...


Not from the same computer, actually it is a network standalone device.

Jul 17 '05 #3

P: n/a
On 16 Mar 2005 00:32:49 -0800, eeh wrote:

But is it the IP address of the machine that's running the code?? It
should be...


Not from the same computer, actually it is a network standalone
device.


If your host doesn't have a network interface with that address, you
can't do it. A socket (Socket or Serversocket) can only bind to the
address of one of the host's network interfaces.

Specifying a portnumber alone works because the address defaults to
the wildcard address (0.0.0.0), which matches all of the host's
interfaces.

What are you trying to do?

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Jul 17 '05 #4

P: n/a
eeh
> If your host doesn't have a network interface with that address, you
can't do it. A socket (Socket or Serversocket) can only bind to the
address of one of the host's network interfaces.
The device does have network interface and the server socket is working

when no specified IP is given. Pinging to the device is successful.
What are you trying to do?


Actually the device is a parallel ethernet converter.

Jul 17 '05 #5

P: n/a
eeh
> > If your host doesn't have a network interface with that address,
you
can't do it. A socket (Socket or Serversocket) can only bind to the
address of one of the host's network interfaces.


OK, I get your meaning. The server socket cannot be applied to a IP
from a remote host.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.