Allows to retrieve data from a UDP multicast group.  
 More...
#include <socket.h>
|  | 
| const char * | getBuffer () | 
|  | Returns a pointer to the internal buffer, holding the received data.  More... 
 | 
|  | 
| int | recv () | 
|  | Retrieve data from multicast group.  More... 
 | 
|  | 
| int | send (const char *buf, unsigned int sz, int port) | 
|  | 
|  | UdpMulticastSocket (const int local_port, const std::string multicast_ip="224.0.0.1") | 
|  | Creates a socket and joins the multicast group with the given address.  More... 
 | 
|  | 
|  | ~UdpMulticastSocket () | 
|  | 
|  | 
| static const int | MAXRECV = 3000 | 
|  | Maximum number of bytse that can be read at a time.  More... 
 | 
|  | 
Allows to retrieve data from a UDP multicast group. 
Definition at line 55 of file socket.h.
◆ UdpMulticastSocket()
      
        
          | UdpMulticastSocket::UdpMulticastSocket | ( | const int | local_port, | 
        
          |  |  | const std::string | multicast_ip = "224.0.0.1" | 
        
          |  | ) |  |  | 
      
 
Creates a socket and joins the multicast group with the given address. 
Definition at line 40 of file socket.cpp.
 
 
◆ ~UdpMulticastSocket()
      
        
          | UdpMulticastSocket::~UdpMulticastSocket | ( |  | ) |  | 
      
 
 
◆ getBuffer()
  
  | 
        
          | const char* UdpMulticastSocket::getBuffer | ( |  | ) |  |  | inline | 
 
Returns a pointer to the internal buffer, holding the received data. 
The buffer size may be obtained from MAXRECV. 
Definition at line 77 of file socket.h.
 
 
◆ recv()
      
        
          | int UdpMulticastSocket::recv | ( |  | ) |  | 
      
 
Retrieve data from multicast group. 
- Returns
- The number of bytes received or -1 if no data is available
This call is non-blocking. 
Definition at line 151 of file socket.cpp.
 
 
◆ send()
      
        
          | int UdpMulticastSocket::send | ( | const char * | buf, | 
        
          |  |  | unsigned int | sz, | 
        
          |  |  | int | port | 
        
          |  | ) |  |  | 
      
 
 
◆ buf
  
  | 
        
          | char UdpMulticastSocket::buf[MAXRECV+1] |  | private | 
 
 
◆ HostAddr
  
  | 
        
          | sockaddr_in UdpMulticastSocket::HostAddr |  | private | 
 
 
◆ m_local_addr
  
  | 
        
          | sockaddr_in UdpMulticastSocket::m_local_addr |  | private | 
 
 
◆ m_socket
  
  | 
        
          | int UdpMulticastSocket::m_socket |  | private | 
 
 
◆ MAXRECV
  
  | 
        
          | const int UdpMulticastSocket::MAXRECV = 3000 |  | static | 
 
Maximum number of bytse that can be read at a time. 
Definition at line 60 of file socket.h.
 
 
◆ remote_ip_exist
  
  | 
        
          | bool UdpMulticastSocket::remote_ip_exist |  | private | 
 
 
The documentation for this class was generated from the following files: