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

RefCountingSocket.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 MN_RTP_REF_COUNTING_SOCKET_H 00025 #define MN_RTP_REF_COUNTING_SOCKET_H 00026 00027 #include <assert.h> 00028 #include <stdio.h> 00029 #include <sys/types.h> 00030 00031 #include "MNUDPServerSocket.h" 00032 #include "MNValid.h" 00033 00034 class RefCountedSocket; 00035 class MNRope; 00036 00037 /**********************************************************************/ 00038 /* RefCountingSocket */ 00039 /**********************************************************************/ 00040 00046 class RefCountingSocket 00047 { 00048 DECLARE_VALID 00049 00050 private: 00051 RefCountedSocket* _s; 00052 00053 public: 00054 RefCountingSocket( const RefCountingSocket& ); 00055 00056 RefCountingSocket( MNSelector& sel, 00057 MNSocket& sock ); 00058 00059 RefCountingSocket( MNSelector& sel, 00060 int port ); 00061 00072 virtual ~RefCountingSocket( ); 00073 00077 void startUdpServer( bool sender); 00078 00086 void stopUdpServer(); 00087 00091 virtual int reader ( MNRope*& rope, 00092 struct sockaddr_in*& dest ) = 0; 00093 00094 virtual void writer ( ) = 0; 00095 00096 bool join_multicast( int port, const char* address ); 00097 00098 bool is_multicast_joined() const; 00099 00104 void set_multicast_ttl( int val ); 00105 00109 int get_multicast_ttl( ); 00110 00111 int get_descriptor( ); 00112 00117 void set_multicast_if( const char* ifname ); 00118 00119 #if 0 00120 int send( struct iovec* iov, 00121 size_t iov_size, 00122 int target_port, 00123 const char* target_addr ); 00124 #endif 00125 00135 int send( MNRope* rope, 00136 const struct sockaddr_in& target_addr ); 00137 00149 int send( struct iovec* iov, 00150 size_t iov_size, 00151 const struct sockaddr_in& target_addr ); 00152 00157 MNSelector& getSelector( ); 00158 }; 00159 00160 #endif /* MN_RTP_REF_COUNTING_SOCKET_H */ 00161

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