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

RTSPProxySessionFactory.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 #ifndef RTSP_PROXY_SESSION_FACTORY_H 00025 #define RTSP_PROXY_SESSION_FACTORY_H 00026 00027 #include "dictionary.h" 00028 #include "MNString.h" 00029 #include "MNMutex.h" 00030 #include "MNSelector.h" 00031 #include "SIPtr.h" 00032 00033 class ControlBase; 00034 class RTSPProxySession; 00035 00036 typedef OS::SIPtr<RTSPProxySession> ProxySessionPtr; 00037 00044 class RTSPProxySessionFactory 00045 { 00048 MNMutex _lock; 00049 int _lastSessionNumber; 00050 dictionary<int,RTSPProxySession*> _sessions_by_id; 00051 int _nextSessionIDdownstream; 00052 00053 public: 00054 RTSPProxySessionFactory( ); 00055 ~RTSPProxySessionFactory( ); 00056 00062 ProxySessionPtr newSession( MNSelector& slct, int fd, MNString url, bool doDynReflection ); 00063 ProxySessionPtr newSession( MNSelector& slct, int fd ); 00064 00065 ProxySessionPtr getSession( int num ); 00066 //ProxySessionPtr getSessionByUrl( MNString url ); 00067 00068 /* This method returns the RTSPProxySession which matches to SessionId. 00069 * If none is found, NULL is returned. This is the standard case in 00070 * unoptimized unicast operation. 00071 * 00072 * NEW: As it may happen, that the SAME SessionID is used _and_ by the 00073 * OS and the proxy (we even want this), the Session has to be 00074 * found with the help of the incoming FillBuffer* too. 00075 */ 00076 ProxySessionPtr findSessionWithSessionID( ControlBase* fb, u_int64_t SessionId ); 00077 00082 ProxySessionPtr findSessionWithCSeq( ControlBase* fb, int CSeq ); 00083 00090 ProxySessionPtr assignSessionId( ControlBase* fb, int cseq, u_int64_t id); 00091 00092 void assignDownstreamSessionId(int sessionNo); 00093 00097 bool forgetSession( u_int64_t sessionId ); 00098 bool forgetSession( ProxySessionPtr Session ); 00099 bool forgetSessionTeardown( ProxySessionPtr Session); 00100 bool forgetSession( RTSPProxySession* Session ); 00101 00106 void forgetSessionsBySocket( int fd ); 00107 00108 private: 00112 RTSPProxySession* private_findOneSessionBySocket( int fd, bool& fromBelow ); 00113 00114 void private_dumpSessions( ); 00115 }; 00116 00117 #endif /* RTSP_PROXY_SESSION_FACTORY_H */ 00118

Generated on Sun Mar 6 13:35:50 2005 for Komssys by doxygen 1.3.8