[Live-devel] RTSP connection loss
Ross Finlayson
finlayson at live555.com
Sat Jan 27 06:35:16 PST 2007
>Hello all,
>
>simple problem - if TCP connection is lost I'm getting 100% CPU usage
>(Win32 and company).
>
>Problem is in liveMedia/RTSPClient.cpp:
>
>void RTSPClient::incomingRequestHandler1() {
>...
> bytesRead = getResponse1(readBuf, fResponseBufferSize);
> if (bytesRead == 0) {
> envir().setResultErrMsg("Failed to read response: ");
> return;
> }
>...
>}
>
>if getResponse1() returns 0 (because of connection loss)
>incomingRequestHandler1() simply returns. Since scheduler has nothing
>else to do it will reschedule incomingRequestHandler1() again and again
>thus raising CPU usage to 100%.
>
>I simply insert Sleep(1) before 'return' operator (Win32 sys call) to
>temporary solve problem.
>
>Does anyone have better solution which could be applied to official
>source tree?
Try adding the following, before the "return" statement:
envir().taskScheduler().turnOffBackgroundReadHandling(fInputSocketNum);
(Let us know if this works; if so, I'll add it to the next code release.)
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list