Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$ testOnDemandRTSPServer
... Play this stream using the URL "rtsp:// ...
$ testOnDemandRTSPServer
Failed to create RTSP server: bind() error (port number: 8554): Address already in use

How to manually explicitly free up the port after a non-REUSEADDR program?

I don't want to wait or change port every time...

share|improve this question
Link:… – Vi. Apr 26 '13 at 11:01

Unfortunately, on Linux there's nothing you can do (other than fixing the code to set SO_REUSEADDR). From man 7 socket:

Linux will only allow port reuse with the SO_REUSEADDR option when this
option was set both in the previous program that performed a bind(2) to
the port and in the program that wants to reuse the port. This differs
from some implementations (e.g., FreeBSD) where only the later program
needs to set the SO_REUSEADDR option. Typically this difference is invisible,
since, for example, a server program is designed to always set this option.
share|improve this answer
Is it just me who annoyed by Address already in use message during development? Maybe somebody hacked up a kernel module that just flushes all TIME_WAIT sockets? – Vi. Apr 26 '13 at 11:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.