Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
$ testOnDemandRTSPServer
... Play this stream using the URL "rtsp://192.168.90.2:8554 ...
^C
$ 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: serverfault.com/questions/329845/… –  Vi. Apr 26 '13 at 11:01

1 Answer 1

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

 
discard

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.