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 |
( |
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 |
( |
| ) |
|
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.
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.
int UdpMulticastSocket::send |
( |
const char * |
buf, |
|
|
unsigned int |
sz, |
|
|
int |
port |
|
) |
| |
char UdpMulticastSocket::buf[MAXRECV+1] |
|
private |
sockaddr_in UdpMulticastSocket::HostAddr |
|
private |
sockaddr_in UdpMulticastSocket::m_local_addr |
|
private |
int UdpMulticastSocket::m_socket |
|
private |
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.
bool UdpMulticastSocket::remote_ip_exist |
|
private |
The documentation for this class was generated from the following files: