Allows to retrieve data from a UDP multicast group. More...
#include <socket.h>
Public Member Functions | |
const char * | getBuffer () |
Returns a pointer to the internal buffer, holding the received data. | |
int | recv () |
Retrieve data from multicast group. | |
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. | |
~UdpMulticastSocket () | |
Static Public Attributes | |
static const int | MAXRECV = 3000 |
Maximum number of bytse that can be read at a time. | |
Private Attributes | |
char | buf [MAXRECV+1] |
sockaddr_in | m_local_addr |
int | m_socket |
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 20 of file socket.cpp.
Definition at line 124 of file socket.cpp.
const char* UdpMulticastSocket::getBuffer | ( | ) | [inline] |
int UdpMulticastSocket::recv | ( | ) |
Retrieve data from multicast group.
This call is non-blocking.
Definition at line 129 of file socket.cpp.
char UdpMulticastSocket::buf[MAXRECV+1] [private] |
sockaddr_in UdpMulticastSocket::m_local_addr [private] |
int UdpMulticastSocket::m_socket [private] |
const int UdpMulticastSocket::MAXRECV = 3000 [static] |