sipxportlib  Version 3.3
OsMulticastSocket.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 
15 #ifndef _OsMulticastSocket_h_
16 #define _OsMulticastSocket_h_
17 
18 // SYSTEM INCLUDES
19 // APPLICATION INCLUDES
20 #include <os/OsDatagramSocket.h>
21 
22 // DEFINES
23 // MACROS
24 // EXTERNAL FUNCTIONS
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
30 
31 //: Implements multicast version of OsDatagramSocket
32 // This class provides the implementation of the multicast UDP datagram
34 {
35 /* //////////////////////////// PUBLIC //////////////////////////////////// */
36 public:
37 
38 /* ============================ CREATORS ================================== */
39 
40  OsMulticastSocket(int multicastPort = PORT_DEFAULT,
41  const char* multicastHostName = NULL,
43  const char* localHostName = NULL);
44 
45  virtual
47  //:Destructor
48 
49 
50 /* ============================ MANIPULATORS ============================== */
51 
53  int joinGroup(const char* multicastHostName);
54 
55  //int leaveGroup(const char* multicastHostName);
56 
58  int setHopCount(unsigned char hopCount);
59 
61  int setLoopback(bool enabled);
62 
63 /* ============================ ACCESSORS ================================= */
65  //: Returns the protocol type of this socket
66 
67 
68 /* ============================ INQUIRY =================================== */
69 
70 /* //////////////////////////// PROTECTED ///////////////////////////////// */
71 protected:
72 
73 /* //////////////////////////// PRIVATE /////////////////////////////////// */
74 private:
75 
76  OsMulticastSocket(const OsMulticastSocket& rOsMulticastSocket);
77  //:Disable copy constructor
78 
79  OsMulticastSocket& operator=(const OsMulticastSocket& rhs);
80  //:Assignment operator
81 
82 };
83 
84 /* ============================ INLINE METHODS ============================ */
85 
86 #endif // _OsMulticastSocket_h_
IpProtocolSocketType
Definition: OsSocket.h:92
int setLoopback(bool enabled)
Enables/disables local loopback of outgoing multicast packets.
Definition: OsMulticastSocket.cpp:159
virtual OsSocket::IpProtocolSocketType getIpProtocol() const
Definition: OsMulticastSocket.cpp:177
#define NULL
Definition: UtlDefs.h:29
int joinGroup(const char *multicastHostName)
Joins a multicast group. Returns 0 on success.
Definition: OsMulticastSocket.cpp:97
OsMulticastSocket(int multicastPort=PORT_DEFAULT, const char *multicastHostName=NULL, int localHostPort=PORT_DEFAULT, const char *localHostName=NULL)
Definition: OsMulticastSocket.cpp:53
Definition: OsDatagramSocket.h:37
int localHostPort
Definition: OsSocket.h:321
virtual ~OsMulticastSocket()
Definition: OsMulticastSocket.cpp:90
Definition: OsMulticastSocket.h:33
#define PORT_DEFAULT
Definition: OsDefs.h:180
int setHopCount(unsigned char hopCount)
Sets the hop count (a.k.a. TimeToLive) for outgoing multicast packets.
Definition: OsMulticastSocket.cpp:144
UtlString localHostName
Definition: OsSocket.h:324