[Live-devel] About long time wait when server isn't available

xcsmith at rockwellcollins.com xcsmith at rockwellcollins.com
Thu Jan 25 09:30:16 PST 2007


>> Appreciate for your help on the issue,
But as my investigation, the client will block in the
function call "connect" in openConnectionFromURL,
Do we need to modify the last parameter of
setupStreamSocket from "False" to "True" for
non-blocking mode?

Re: This doesn't seem so for me.  I just tried my build again with that
parameter set to True, and my software always returned immediately and did
nothing.  I think connect has its own timeout on it maybe?  I see something
in the man pages about ETIMEDOUT.  I'm no socket expert, but I don't think
the socket should be set up as you suggest unless maybe some other setting
is changed too.

When I leave this set to false, my software returns correctly after the
wait period if the RTSP server is not available, but only on the read
calls. The connect call seems to have its own timeout, and returns quickly
when I request a non-existent RTSP server on a neighboring workstation or a
computer that does not exist.  However, I tried asking for a non-existent
RTSP server from one of our file servers, and the wait is extremely long
(on the order of a couple minutes) but it still returned.  This seems
logical to me based on the man pages.

I don't think blocking infinitely on connect was part of the initial
problem you were seeing, I think that it is only the infinite blocking on
the read attempts that are the issue.  The original RTSP client sends a
message and then blocks while waiting for the expected RTSP server
response.  I think this is the only blocking problem we need to solve.

>> and it seems that the "connect" call will immediately
return with error EINPROGRESS,
in my opinion, we should check if the errno is
EINPROGRESS and then continue, isn't it?
and in that case, later the RTSPClient will send
request to the server,
should we wait for the signal of successfully
connected?

Re: RTSPClient::openConnectionFromURL() returns False if the connection is
not successful, and all the RTSP methods in RTSPClient check the return
value.  RTSPClient doesn't try to send any information if the connection
fails, so I think RTSPClient already does what you are suggesting.

Xochitl





More information about the live-devel mailing list