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 is 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 21 of file Socket.cpp.
Definition at line 125 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 130 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] |