If I attempt to run my own Python program which listens on a particular port, I may get:

socket.error: [Errno 98] Address already in use

If the program didn't terminate gracefully.

While this may be resolved by writing the program differently, as a system administrator, what is the right way to deal with it -- if you simply have a badly written program?

There doesn't seem to be any process using the port, yet it is still reserved for this use. lsof and netstat doesn't give me anything I can kill, so what should I do to quickly be able to reuse the port without modifying the program in question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.