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

delete_UDPReceiver.h

Go to the documentation of this file.
00001 #if 0 00002 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00003 * 00004 * You are allowed to use all other parts of the code under the following terms: 00005 * 00006 * For non-commercial use, code may be used in unmodified form provided 00007 * that this copyright notice and this permission notice appear in 00008 * supporting documentation. 00009 * 00010 * This software is provided "as is" and without any express or implied 00011 * warranties, including, without limitation, the implied warranty of 00012 * fitness for a particular purpose. 00013 * 00014 * The code may be subjected to the GNU General Public License, Version 2, 00015 * and re-distributed under the terms of this license. 00016 * As a special exception, permission is granted to link this code 00017 * with the Qt library and distribute executables, as long as you 00018 * follow the requirements of the GNU GPL in regard to all of the 00019 * software in the executable aside from Qt. 00020 * 00021 * Commercial use other than under the terms of the GNU General Public 00022 * License is allowed only after express negotiation of conditions 00023 * with the authors. 00024 */ 00025 #ifndef UDPRECEIVER_H 00026 #define UDPRECEIVER_H 00027 00028 /* include some files */ 00029 #include <unistd.h> 00030 #include <string.h> 00031 #include "MNRTPFileAndUDPStreamer.h" 00032 #include "MNMutex.h" 00033 #include "MNProtectedVar.h" 00034 #include "MNlogger.h" 00035 #include "MNRTPevent.h" 00036 #include "MNRTPcallback.h" 00037 00038 class UDPReceiver : public MNRTPevent 00039 , public MNRTP_RTCPbye_callback 00040 // , public MNRTPcallback 00041 { 00042 private: 00043 /* vars */ 00044 char* version_text; 00045 MNlogger logger; 00046 MNMutex initialized; 00047 00048 /* filestreamer vars */ 00049 MNRTPFileAndUDPStreamer* filestreamer; 00050 ProtectedVar<unsigned int> bandwidth; 00051 ProtectedVar<int> _port; 00052 ProtectedVar<int> id; 00053 char* target; 00054 MNMutex target_mutex; 00055 char* file_name; 00056 MNMutex file_name_mutex; 00057 ProtectedBool forced; 00058 ProtectedVar<unsigned int> forced_timeout; 00059 ProtectedVar<unsigned int> forced_packet_size; 00060 ProtectedVar<int> ttl; 00061 ProtectedVar<int> udp_port; 00062 00063 /* flags */ 00064 ProtectedBool verbose; 00065 ProtectedBool log; 00066 ProtectedBool ende; 00067 ProtectedBool started; 00068 00069 /* pipe comm */ 00070 fd_set read_set, write_set, except_set; 00071 MNMutex fdset_mutex; 00072 int notify_pipe[2]; 00073 00074 /* functions */ 00075 void wake( const char* text ); 00076 void init(); 00077 void selectIT(); 00078 00079 /* callbacks */ 00080 virtual void StreamEvent(stream_event_t event, int fd); 00081 virtual void StreamError(int error, int fd); 00082 virtual void RTCPbye_cb(u_int32 ssrc, text_item_t *bye_text); 00083 /* if opening more than one UDP port simultanously, implement the event callbacks UDPPort and UDPtarget */ 00084 00085 public: 00086 UDPReceiver(); 00087 virtual ~UDPReceiver(); 00088 00089 bool ParseCmdLine(int argc, char* argv[]); 00090 const char* GetVer(); 00091 const char* Usage(); 00092 void TzStart(); 00093 void Stop(); 00094 00095 /* options */ 00096 void SetVerbose(); 00097 void UnsetVerbose(); 00098 void SetLog(); 00099 void UnsetLog(); 00100 void SetBandwidth(unsigned int bw); 00101 unsigned int GetBandwidth(); 00102 void SetPort(int port_); 00103 int GetPort(); 00104 void SetId(int id_); 00105 int GetId(); 00106 void SetHost(const char* host); 00107 char* GetHost(); 00108 void SetForced(); 00109 void UnsetForced(); 00110 bool GetForced(); 00111 void SetFname(const char* text); 00112 char* GetFname(); 00113 void SetForcedPacketSize(unsigned int val); 00114 unsigned int GetForcedPacketSize(); 00115 void SetForcedTimeout(unsigned int val); 00116 unsigned int GetForcedTimeout(); 00117 void SetTtl(int val); 00118 int GetTtl(); 00119 void SetUdpPort(int val); 00120 int GetUdpPort(); 00121 }; 00122 00123 #endif 00124 00125 #endif 00126

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