[Live-devel] About the response of the RTSPserver
Ross Finlayson
finlayson at live.com
Sun Dec 12 14:47:29 PST 2004
> I have a question about the response of the RTSPserver:
> when we create a rstpserver,it arranges a handler (
> RTSPServer::incomingConnectionHandler())to handle connections from others
> ,when a user first connection to the server,general he will send a RTSP
> command "DESRCIBE" first, the server recieve the command and create a new
> RTSPClientsession object to service the user. when create the
> RTSPClientsession object ,it also arrange a
> handler(RTSPServer::RTSPClientSession
>::incomingRequestHandler()) to respond the user's request.but I wonder if
>the server can respond the request "DESCRIBE" this time rightly.When we
>arrange a handler to handle the user's request, we have recieved the first
>request, the handler can't handle this request,so I think it will ingore
>the first request command. Is that right?
TZP,
Unfortunately I didn't fully understand your question, but I'll try to
answer it by explaining how the "RTSPServer" code handles RTSP client requests.
The server handles each new client TCP connection (to the RTSP server port
- e.g., 554) using the routines "RTSPServer::incomingConnectionHandler()"
and "RTSPServer::incomingConnectionHandler1()". This calls "accept()" to
get a new socket just for this client connection. It then creates a new
"RTSPClientSession" object to handle incoming requests for this client
connection. Note that each "RTSPClientSession" object handles only one
ongoing client connection. Note also that the "RTSPServer" object does not
read any data from a client; it just calls "accept()". Only the
"RTSPClientSession" object reads (and handles) data from the client.
If you add
#define DEBUG 1
to the top of "RTSPServer.cpp", you will see a debugging print out of the
RTSP server code as it works.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list