[Live-devel] Cleanly close RTSP Server

Ross Finlayson finlayson at live555.com
Tue Feb 19 14:33:36 PST 2019



> On Feb 20, 2019, at 7:53 AM, Kevin Bailey <kevin at pudle.io> wrote:
> 
> My particular use case has my program started and stopped rapidly in short periods of time. But I can't start and stop it like this if I can't quickly re-bind to the rtsp port. Maybe this doesn't have anything to do with my clean up code? Is it related to this: https://live-devel.live555.narkive.com/0XXB7m6u/rtsp-server-socket-bind-error ?

Yes, it’s completely related to that (and has nothing to do with the ‘clean up’ code in either your server or client).  It’s a feature of the TCP protocol.

But if you are sure that nobody will ever try to run the server more than once at the same time on the same computer, then you can compile “liveMedia/GenericMediaServer.cpp” with -DALLOW_SERVER_PORT_REUSE=1 (see lines 145-150 of "liveMedia/GenericMediaServer.cpp”).  This should allow you to restart the server immediately after you kill it.


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




More information about the live-devel mailing list