Is my Socket Free or Listening

Hi,

bash-3.2$ uname -a
Linux mymac 2.6.18-409.el5 #1 SMP Fri Feb 12 06:37:28 EST 2016 x86_64 x86_64 x86_64 GNU/Linux

bash-3.2$ telnet 10.12.228.40 13900
Trying 10.12.228.40...
telnet: connect to address 10.12.228.40: Connection refused
bash-3.2$ telnet 10.12.228.40 23900
Trying 10.12.228.40...
Connected to 10.12.228.40.
Escape character is '^]'.
Connection closed by foreign host.

bash-3.2$ telnet 10.12.228.40 24000
Trying 10.12.228.40...
telnet: connect to address 10.12.228.40: Connection refused

This makes me believe 10.12.228.40 24000 is free for use.

But when i start a process on that socket 10.12.228.40 24000 it fails saying

The address 10.12.228.40 might be incorrect or another process is using port 24000: java.net.BindException: Cannot assign requested address

Please explain.

Does it fail on every port or just that one? If it fails on every port, it might have some other problem.

Please ignore this Thread for now.

Looks like i was on a different box.

1 Like