PDA

View Full Version : closing "orphan" port


d@r
05-27-2003, 10:46 PM
I ran a program who bound to a cetain port, then called "listen" and then "accpet".
Then I had close that process using "kill".
The problem is that now whenever I try to bind to that port I get the error "address already in use".
(even though I called setsockopt with REUSEADDR)

When I run netstat i see a line telling saying this port is listening.
How can I release it?
(unfortunately, rebooting is not an option)

RobSeace
05-28-2003, 06:32 PM
You obviously didn't actually kill the app that's listening, then...
If you're on a Linux system, do "netstat -ap", and it should show
you the program that owns that listening socket... Or, if you've
got something like "lsof" installed, use that to find the program...
Then, kill that program...