[Live-devel] Restarting RTP Session Issue

Ross Finlayson finlayson at live555.com
Thu Apr 5 23:23:02 PDT 2012


> When I am canceling and restarting the thread on camera events  I am getting following error message and streaming is not started.
>  
> Failed to create RTSP server: bind() error (port number: 8554): Address already in use
>  
> I guess the socket is not being closed on thread cancellation.

Correct.  Because the *process* (which owns the socket) still exists, the socket remains open, even though the *thread* that happens to be using the socket has closed.  This is because (for most operating systems, at least) the operating system knows nothing about threads; it deals with processes.

Why don't you instead simply restart the entire *process*, rather than trying to restart a thread within a still-running process?

However, having said that, the following *might* work for you (although I can't say for sure):
Add
	-D ALLOW_RTSP_SERVER_PORT_REUSE=1
to the "COMPILE_OPTS =" line of your "config." file.   Then, recompile "RTSPServer.cpp".


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120405/87802d1a/attachment.html>


More information about the live-devel mailing list