SSession Class Reference

This class contains all information about an active streaming session. More...

#include <SSession.hpp>

List of all members.


Public Member Functions

 SSession (uint RtspSessionId, char *URL, char *clientAdr, char *SemiMovieId, uint OriginRtspSessionId, ulong prevDuration, uint bufferingDelayms, TimeMeasurement *timemsmnt)
 Constructor called from SemiProxy.
 SSession (uint RtspSessionId, char *URL, char *clientAdr, char *SemiMovieId, uint OriginRtspSessionId, ulong estMsecsElapsed, uint State, ulong duration, ulong prevDuration, uint tsCount, ulong tsCreation, ulong tsClosed)
 Constructor called from SemiServer.
 ~SSession ()
 default destructor
uint getRtspSessionId ()
void setRtspSessionId (uint SessionId)
 set Rtsp Session-Id of this session
char * getUrl ()
char * getClientAdr ()
char * getSemiMovieId ()
uint getOriginRtspSessionId ()
ulong getPreviousSessionDuration ()
ulong getElapsedMsecs (uint sectionNr=0, ulong serverPlayout=0, ulong clientPlayout=0)
ulong getDuration ()
uint getTimeSectionCount ()
uint getBufferingDelay ()
uint getState ()
ulong getTimestampCreated ()
ulong getTimestampClosed ()
void setActive ()
 Set current session state to STATE_RUNNING.
void setInactive ()
 Set current session state to STATE_PAUSED.
void setClosed ()
 mark this session as 'closed by the client'
bool isClosed ()
bool isMaster ()

Detailed Description

This class contains all information about an active streaming session.

It is used from SessionMgmt.cpp (on proxy-side) and from SessionList.cpp (on server-side).

Author:
Klaus Schoeffmann

Definition at line 76 of file SSession.hpp.


Member Function Documentation

uint SSession::getBufferingDelay  ) 
 

Returns:
buffering delay of the device(profile) used by this session.
Definition at line 182 of file SSession.cpp.

Referenced by SessionMgmt::listSessions().

00183 { 00184 return bufferingDelayms; 00185 }

char * SSession::getClientAdr  ) 
 

Returns:
client-address of this session.
Definition at line 164 of file SSession.cpp.

Referenced by SessionMgmt::listSessions(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00165 { 00166 return (char *)clientAdr->c_str(); 00167 }

ulong SSession::getDuration  ) 
 

Returns:
duration of this session
Definition at line 215 of file SSession.cpp.

References TimeMeasurement::getDuration().

Referenced by SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00216 { 00217 if (timemsmnt != NULL) 00218 { 00219 //called from semiproxy 00220 return timemsmnt->getDuration(); 00221 } 00222 else 00223 { 00224 //called from semiserver 00225 return duration; 00226 } 00227 }

ulong SSession::getElapsedMsecs uint  sectionNr = 0,
ulong  serverPlayout = 0,
ulong  clientPlayout = 0
 

Returns:
estimated elapsed time of the session.
Definition at line 200 of file SSession.cpp.

References TimeMeasurement::getElapsedTime().

Referenced by SessionMgmt::listSessions(), SemiProxySession::play(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00201 { 00202 if (timemsmnt != NULL) 00203 { 00204 //called from semiproxy 00205 return timemsmnt->getElapsedTime(sectionNr, serverPlayout, clientPlayout); 00206 } 00207 else 00208 { 00209 //called from semiserver 00210 return estMsecsElapsed; 00211 } 00212 }

uint SSession::getOriginRtspSessionId  ) 
 

Returns:
Rtsp Session-ID of the origin session (on migration).
Definition at line 176 of file SSession.cpp.

Referenced by SessionMgmt::listSessions(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00177 { 00178 return OriginRtspSessionId; 00179 }

ulong SSession::getPreviousSessionDuration  ) 
 

Returns:
duration of the origin session (on migration)
Definition at line 230 of file SSession.cpp.

References TimeMeasurement::getPreviousSessionDuration().

Referenced by SemiProxySession::play(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00231 { 00232 if (timemsmnt != NULL) 00233 { 00234 //called from semiproxy 00235 return timemsmnt->getPreviousSessionDuration(); 00236 } 00237 else 00238 { 00239 //called from semiserver 00240 return prevDuration; 00241 } 00242 }

uint SSession::getRtspSessionId  ) 
 

Returns:
Rtsp Session-Id of this session.
Definition at line 146 of file SSession.cpp.

Referenced by SessionMgmt::getSession(), SessionMgmt::listSessions(), SessionMgmt::removeSession(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), SSession(), SessionList::writeHTMLRepresentation(), and ~SSession().

00147 { 00148 return this->RtspSessionId; 00149 }

char * SSession::getSemiMovieId  ) 
 

Returns:
semi-movie-id of the session.
Definition at line 170 of file SSession.cpp.

Referenced by SessionMgmt::listSessions(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00171 { 00172 return (SemiMovieId == NULL) ? (char*)(new string(""))->c_str() : (char *)SemiMovieId->c_str(); 00173 }

uint SSession::getState  ) 
 

Returns:
current state of session.
Definition at line 260 of file SSession.cpp.

Referenced by SemiProxySession::handlePlayResponse(), SemiProxySession::play(), SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00261 { 00262 return State; 00263 }

uint SSession::getTimeSectionCount  ) 
 

Returns:
number of time-sections in this session
Definition at line 245 of file SSession.cpp.

References TimeMeasurement::getTimeSectionCount().

Referenced by SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00246 { 00247 if (timemsmnt != NULL) 00248 { 00249 //called from semiproxy 00250 return timemsmnt->getTimeSectionCount(); 00251 } 00252 else 00253 { 00254 //called from semiserver 00255 return tsCount; 00256 } 00257 }

ulong SSession::getTimestampClosed  ) 
 

Returns:
timestamp of termination in secs
Definition at line 296 of file SSession.cpp.

Referenced by SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00297 { 00298 return tsClosed; 00299 }

ulong SSession::getTimestampCreated  ) 
 

Returns:
timestamp of creation in secs
Definition at line 290 of file SSession.cpp.

Referenced by SessionList::retrieveSessions(), ServerCommunication::sendSessionsToServer(), and SessionList::writeHTMLRepresentation().

00291 { 00292 return tsCreation; 00293 }

char * SSession::getUrl  ) 
 

Returns:
URI of this session.
Definition at line 158 of file SSession.cpp.

Referenced by SessionMgmt::listSessions(), SessionList::retrieveSessions(), and ServerCommunication::sendSessionsToServer().

00159 { 00160 return (char *)URL->c_str(); 00161 }

bool SSession::isClosed  ) 
 

Returns:
true if this session has been closed by the client, otherwise false
Definition at line 278 of file SSession.cpp.

Referenced by SemiProxySession::closeSession(), and SessionList::writeHTMLRepresentation().

00279 { 00280 return (State == STATE_CLOSED); 00281 }

bool SSession::isMaster  ) 
 

Returns:
true if this session is a master session (a potential source of a migration)
Definition at line 284 of file SSession.cpp.
00285 { 00286 return (OriginRtspSessionId == 0); 00287 }


The documentation for this class was generated from the following files: