[Live-devel] RTSP Server 400 response terminates server-side connection

xcsmith at rockwellcollins.com xcsmith at rockwellcollins.com
Tue Apr 24 13:04:03 PDT 2007


Ross,

I am troubleshooting my openRTSP-based application using mediaServer.  My
client terminates with the error "Broken Pipe."  I have traced this back to
happening in RTSPClient::sendRequest() at the line where send () is called.
I hope you could read through my description of the problem and tell me if
you think my analysis is correct:

My RTSP client is inherited from RTSPClient class, and it's main difference
is to operate in connectionless mode when needed.  So after each RTSP
message it calls RTSPClient::resetTCPSockets().  But I need to allow the
user the option to work in connection-oriented mode.  So, I created a
function "Boolean setConnectionOrientedMode(Boolean stayConnected)."   Now,
when I use my client, first I do DESCRIBE & SETUP, then I call the
setConnectionOrientedMode(True) so that the client will not disconnect
anymore.  (I know that the mediaServer will not allow me to disconnect
after SETUP, but keep reading.)  The next message I sent was a test
message, to show that the LIVE555 server will respond to anything ending in
<CR><LF><CR><LF>.  (To demonstrate mediaServer meets requirements.)  So I
send the message "GARBAGE\r\n\r\n".  mediaServer replies with 400 Bad
Request.  Perfect.  Now, the NEXT time I send a message, no matter what
RTSP message it is, my client does not send the message (verified in
ethereal) and terminates with "Broken Pipe."

I looked through the RTSPServer::RTSPClientSession class, and I see that
when a 400-type error code is generated, RTSPServer::RTSPClientSession sets
fSessionIsActive = false.  So, what I think happens is that the
RTSPClientSession created to handle the incoming "GARBAGE message" errors &
cleans up the connection.  Then, my RTSPClient doesn't take into account
that the server closed the connection.  The next time I send an RTSP
message, the server-side disconnect causes my client to choke and die with
error "Broken Pipe".  (openRTSP terminates when there is an RTSP problem,
so this type of thing doesn't happen to openRTSP.)

Does this sound on the money?

Thanks very much for your input!
Xochitl



More information about the live-devel mailing list