[Live-devel] About RTSPServer
Warren Young
warren at etr-usa.com
Tue May 24 08:25:15 PDT 2011
On 5/24/2011 12:57 AM, RA-Vincent Kao wrote:
> but socket still exists (check netstat -a).
If you're seeing a TIME_WAIT state, that's normal and unavoidable:
http://tangentsoft.net/wskfaq/articles/debugging-tcp.html
If it's a FIN_WAITx or SYN_x state, one of the ends of the connection
isn't closing down properly. See the state-transition diagram linked
from that article to debug it.
If the core problem is that the server can't restart for some time after
being stopped due to the TIME_WAIT state, add a setsockopt(SO_REUSEADDR)
after the socket() call.
Ross, it would be nice to see this in core. I know the standards say
there's a risk of misdelivered data if you don't wait the full 2*MSS for
rogue packets, but it's a pretty common thing to do in a server.
More information about the live-devel
mailing list