SemiProxySession Class Reference
This class is used to handle a single rtsp-session. More...
#include <SemiProxySession.hpp>
Inheritance diagram for SemiProxySession:
Public Member Functions | |
SemiProxySession (int fdclient, struct sockaddr_in *clientsock, SemiProxy *sp) | |
default constructor | |
~SemiProxySession () | |
default destructor | |
void | run () |
Reads messages from client and server until the end of this session. | |
void | parseResponseFromServer (char *buffer, int len) |
This function parses the response from the server. | |
void | forwardToServer (char *buffer, int len) |
This function forwards a message to the server. | |
void | forwardToClient (char *buffer, int len) |
Forwards a message to the client. | |
void | handleOptionsResponse (string &buf, int &bytesRead) |
Handles the OPTIONS-response from the server. | |
void | handleDescribeResponse (string &buf, int &bytesRead) |
Handles the DESCRIBE-response from the server. | |
void | handleSetupResponse (string &buf, int &bytesRead) |
Handles the SETUP-response from the server. | |
void | handlePlayResponse (string &buf, int &bytesRead) |
Handles the PLAY-response from the server. | |
void | handlePauseResponse (string &buf, int &bytesRead) |
Handles the PAUSE-response from the server. | |
void | handleTeardownResponse (string &buf, int &bytesRead) |
Handles the TEARDOWN-response from the server. | |
bool | getOptions (const Url *fileName, const char *remaining) |
Handles a GET_PARAMETER message, sent from the client. | |
bool | setOptions (const Url *fileName, const char *remaining) |
Handles a SET_PARAMETER message, sent from the client. | |
bool | options (const Url *fileName, const char *remaining) |
Parses a OPTIONS message and forwards it to the server. | |
bool | connect (const Url *fileName, const char *remaining) |
Parses a DESCRIBE message and forwards it to the server. | |
bool | setup (const Url *fileName, const char *remaining) |
Parses a SETUP message and forwards it to the server. | |
bool | play (const Url *fileName, const char *remaining) |
Parses a PLAY message and forwards it to the server. | |
bool | pause (const Url *fileName, const char *remaining) |
Handles a PAUSE message, sent from the client. | |
bool | tearDown (int sessionKey, bool immediate=false, const Url *fileName=NULL, const char *remaining=NULL) |
Handles a TEARDOWN message, sent from the client. | |
bool | containsSessionID (uint SessionID) |
Look if specified SessionID is contained in any track of this session. | |
uint | getServerTimeMs () |
Retrieve current 'client playout time' of this session from server. | |
uint | getClientTimeMs () |
Retrieve current 'client playout time' of this session from client. | |
void | testClientOptions () |
uint | requestServerTimeMs () |
Initiate request of current 'client playout time' of this session on next main-loop run from the serrver. | |
uint | requestClientTimeMs () |
Initiate request of current 'client playout time' of this session on next main-loop run from the client. | |
void | sendTeardownToClient () |
Send a Rtsp-TEARDOWN to the client. | |
void | closeSession () |
Close the current session (by closing the socket to client and server) Furthermore, the SSession object is marked as 'closed'. | |
void | removeSession () |
Close the current session (by closing the socket to client and server) Furthermore, the SSession object is removed from the sessionlist. | |
void | setUrl (const Url *uri, bool makeExactMatch=true) |
Empty method which is created for conformance to Session.cpp. | |
void | setStateClosed () |
Set the session state. | |
PlayerInformation | getPlayerInfo () |
Static Public Member Functions | |
SemiProxySession * | getSemiProxySession (uint RtspSessionId) |
Return the reference to a particular session from the static vector of this class. |
Detailed Description
This class is used to handle a single rtsp-session.It contains the most functionality of the semiproxy application.
- Author:
- Klaus Schoeffmann
Definition at line 97 of file SemiProxySession.hpp.
Member Function Documentation
|
Forwards a message to the client. Also replaces the CSeq value, set by the server to the stored CSeq value received from the client! Definition at line 588 of file SemiProxySession.cpp. References getClientTimeMs(), URIParameters::getFullURI(), URIParameters::getHost(), getPlayerInfo(), URIParameters::getPort(), getSemiProxySession(), semifunc::replaceStr(), TimeMeasurement::setTSclientPlayout(), SemiProxy::shouldRequestClientPosition(), and TimeMeasurement::startTS(). Referenced by handleDescribeResponse(), handleOptionsResponse(), handlePauseResponse(), handlePlayResponse(), handleSetupResponse(), and handleTeardownResponse().
|
|
This function forwards a message to the server. It also looks for parameters specified in the RTSP-URI and removes it. If message-type is DESCRIBE and a profile-ID was specified, also the TerminalCapabilites (of the specified profile) will be added. Furthermore, this function stores the received CSeq value from the client. Definition at line 482 of file SemiProxySession.cpp. References URIParameters::getHost(), URIParameters::getPort(), ProfileList::getProfileById(), URIParameters::getProfileId(), SemiProxy::getProfileList(), and SemiProxy::shouldAddTermCaps(). Referenced by connect(), getOptions(), options(), pause(), play(), setOptions(), setup(), and tearDown().
|
|
This function parses the response from the server. Depending on this response, this function either
References URIParameters::getMovieId(), URIParameters::getProfileId(), URIParameters::getUserId(), handleDescribeResponse(), handleOptionsResponse(), handlePauseResponse(), handlePlayResponse(), handleSetupResponse(), and handleTeardownResponse(). Referenced by run().
|
|
Parses a PLAY message and forwards it to the server. If the URI of this message contains an existing RTSP-Session-ID (which means, this session should take over the other session), the Range- Parameter of this message will be replaced by the current time of the other session. This function also extracts the RTSP-SessionId of the message. Implements Session. Definition at line 948 of file SemiProxySession.cpp. References TimeMeasurement::addNewSection(), RTSP::extractSessionKeyFromCMD(), forwardToServer(), Profile::getBufferingDelayms(), SSession::getElapsedMsecs(), getPlayerInfo(), SSession::getPreviousSessionDuration(), ProfileList::getProfileById(), URIParameters::getProfileId(), SemiProxy::getProfileList(), URIParameters::getRange(), URIParameters::getSection(), getSemiProxySession(), SemiProxy::getSession(), URIParameters::getSessionId(), SSession::getState(), URIParameters::getSubtractSecs(), TrackList::getTCHavingState(), requestClientTimeMs(), requestServerTimeMs(), TimeMeasurement::setTSrequestedFrom(), SemiProxy::shouldRequestClientPosition(), SemiProxy::shouldRequestServerPosition(), and Url::toString().
|
|
Reads messages from client and server until the end of this session. The messages will be parsed and forwarded to the opponent. Implements VThread. Definition at line 1630 of file SemiProxySession.cpp. References RTSP::applyReqToSession(), closeSession(), Session::determineProtocol(), getClientTimeMs(), Protocol::getID(), getServerTimeMs(), parseResponseFromServer(), removeSession(), URIParameters::setAction(), URIParameters::setFullURI(), URIParameters::setHost(), URIParameters::setMovieId(), URIParameters::setPort(), URIParameters::setProfileId(), URIParameters::setRange(), URIParameters::setSection(), URIParameters::setSessionId(), URIParameters::setSubtractSecs(), URIParameters::setUserId(), TimeMeasurement::stopTS(), and tearDown().
|
|
Parses a SETUP message and forwards it to the server. Also inserts a destination parameter, which is set to the address of the client that sent this message, into the the message. Implements Session. Definition at line 901 of file SemiProxySession.cpp. References TrackList::addTrack(), forwardToServer(), and SemiProxy::shouldAddDestination().
|
|
Empty method which is created for conformance to Session.cpp.
Implements Session. Definition at line 1173 of file SemiProxySession.cpp.
|
The documentation for this class was generated from the following files: