MulticastSocket.h++

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002    commonc++ - A C++ Common Class Library
00003    Copyright (C) 2005-2012  Mark A Lindner
00004 
00005    This file is part of commonc++.
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public
00018    License along with this library; if not, write to the Free
00019    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020    ---------------------------------------------------------------------------
00021 */
00022 
00023 #ifndef __ccxx_MulticastSocket_hxx
00024 #define __ccxx_MulticastSocket_hxx
00025 
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/DatagramSocket.h++>
00028 #include <commonc++/NetworkInterface.h++>
00029 #include <commonc++/String.h++>
00030 
00031 namespace ccxx {
00032 
00039 class COMMONCPP_API MulticastSocket : public DatagramSocket
00040 {
00041   public:
00042 
00047   MulticastSocket(uint16_t port = 0) throw();
00048 
00050   ~MulticastSocket() throw();
00051 
00057   void join(const String &address) throw(SocketException);
00058 
00064   void join(const InetAddress &address) throw(SocketException);
00065 
00072   void join(const String &address, const NetworkInterface& ixface)
00073     throw(SocketException);
00074 
00081   void join(const InetAddress &address, const NetworkInterface& ixface)
00082     throw(SocketException);
00083 
00089   void leave(const String &address) throw(SocketException);
00090 
00096   void leave(const InetAddress &address) throw(SocketException);
00097 
00104   void leave(const String &address, const ccxx::NetworkInterface& ixface)
00105     throw(SocketException);
00106 
00113   void leave(const InetAddress &address,
00114              const ccxx::NetworkInterface& ixface)
00115     throw(SocketException);
00116 
00124   void setTTL(uint8_t ttl) throw(SocketException);
00125 
00130   uint8_t getTTL() const throw(SocketException);
00131 
00140   void setLoopbackEnabled(bool enabled) throw(SocketException);
00141 
00147   bool isLoopbackEnabled() const throw(SocketException);
00148 
00150   static uint8_t TTL_HOST;
00152   static uint8_t TTL_SUBNET;
00154   static uint8_t TTL_SITE;
00156   static uint8_t TTL_REGION;
00158   static uint8_t TTL_CONTINENT;
00160   static uint8_t TTL_UNRESTRICTED;
00161 
00162   private:
00163 
00164   void verifyAddress(const InetAddress &address) throw(SocketException);
00165 
00166   uint16_t _port;
00167 
00168   CCXX_COPY_DECLS(MulticastSocket);
00169 };
00170 
00171 }; // namespace ccxx
00172 
00173 #endif // __ccxx_MulticastSocket_hxx
00174 
00175 /* end of header file */
Generated on Sat Nov 26 16:49:07 2011 for libcommonc++ by  doxygen 1.6.3