UNIX Support: Bind Address Already in Use Error Message
Have you ever got this error message?
bind: Address already in use |
---|
If you know what port number that your program is using, then you can query the operating system to see who has the port locked or binded. Let us assume that the port number that you are trying to use is port 45078. So, this command will display the status of this port:
netstat -a | grep 45078 |
---|
tcp 0 0 *.45078 *.* LISTEN |
---|
tcp 0 0 MACHINE_NAME.45078 IP_ADDRESS.PROCESS_ID CLOSE_WAIT |
---|
First, try running this netstat command several times to see if the port becomes free automatically.
Otherwise with this information, you have three possible solutions to resolve this problem. First, kill the process id if it is still an active process. Second, using the IP address, find the machine that is locking the port on your machine. You can either terminate the process that is keeping this port locked on this other machine or you can reboot this other machine. Finally, of course, you can always reboot your machine to severe this port connection too.
I hoped this helped.
by Phil for Humanity
on 04/29/2009