Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRTSPSessionFactory Class Reference

#include <MNRTSPSessionFactory.h>

Collaboration diagram for MNRTSPSessionFactory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MNRTSPSessionFactory ()
ServerSessionPtr newSession (const MNString &initialPath, MNSelector &selector, int fd)
ServerSessionPtr findSession (int sessionId)
ServerSessionPtr findSession (const MNString &name)
bool hasSession (int sessionId)
 Simpler form for findSession.
bool hasSession (const MNString &name)
 Simpler form for findSession.
ServerSessionPtr findMulticastSession (const MNString &name)
bool hasMulticastSession (const MNString &name)
 Simpler form for findSession.
void forgetSession (int sessionId)
void forgetSessionsBySocket (int fd)

Detailed Description

The class is responsible for the creation and storage of server sessions. This class assigns session ids to sessions, to be used in RTSP's session identifier. The sessions are stored in internal tables of the factory and can be identified later by their session id. This is typically the case when an RTSP message arrives.

A secondary means to identify a session is through its socket descriptor (fd). This secondary means is necessary to allow the implicit teardown of a session if the remote host has simply closed the connection (e.g. due to a crash, incorrect implementation etc) and no teardown message is sent from the other side.

It would be intuitive to store the session by socket alone. Unfortunately, this is a bit difficult because we want to have multiplexing capabilities. This is not an exclusion criterion. But additionally, we want to keep the session id an integer, although the RTSP RFC does not demand this. However, some clients require integer session ids (we had this bug as well). We may decide to change this behaviour or make it optional, and use literals as session identifiers.


Constructor & Destructor Documentation

MNRTSPSessionFactory::MNRTSPSessionFactory  ) 
 


Member Function Documentation

ServerSessionPtr MNRTSPSessionFactory::findMulticastSession const MNString name  ) 
 

See also:
findSession

ServerSessionPtr MNRTSPSessionFactory::findSession const MNString name  ) 
 

Find a session by requested filename. This function is used in optimized multicast operations, to find out whether a file is already in transfer, and whether a new client can be requested to join the session.

ServerSessionPtr MNRTSPSessionFactory::findSession int  sessionId  ) 
 

Find a session by its session id. This is the standard case in unoptimized unicast operation.

void MNRTSPSessionFactory::forgetSession int  sessionId  ) 
 

Remove a session from the list that performs a correct teardown and that has provided a valid session id.

void MNRTSPSessionFactory::forgetSessionsBySocket int  fd  ) 
 

Delete all sessions that were multiplexed onto an RTSP socket that was closed.

bool MNRTSPSessionFactory::hasMulticastSession const MNString name  ) 
 

Simpler form for findSession.

bool MNRTSPSessionFactory::hasSession const MNString name  ) 
 

Simpler form for findSession.

bool MNRTSPSessionFactory::hasSession int  sessionId  ) 
 

Simpler form for findSession.

ServerSessionPtr MNRTSPSessionFactory::newSession const MNString initialPath,
MNSelector selector,
int  fd
 

Create a new session for access to the file(s) that are identified by the given initialPath. Keep the RTSP socket description for an possible implicit teardown operation.


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:02 2005 for Komssys by doxygen 1.3.8