Public Member Functions | Static Public Attributes | Private Attributes
UdpMulticastSocket Class Reference

Allows to retrieve data from a UDP multicast group. More...

#include <socket.h>

List of all members.

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

Detailed Description

Allows to retrieve data from a UDP multicast group.

Definition at line 65 of file socket.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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 87 of file socket.h.

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 129 of file socket.cpp.


Member Data Documentation

char UdpMulticastSocket::buf[MAXRECV+1] [private]

Definition at line 94 of file socket.h.

sockaddr_in UdpMulticastSocket::m_local_addr [private]

Definition at line 92 of file socket.h.

Definition at line 91 of file socket.h.

const int UdpMulticastSocket::MAXRECV = 3000 [static]

Maximum number of bytse that can be read at a time.

Definition at line 70 of file socket.h.


The documentation for this class was generated from the following files:


mocap_optitrack
Author(s): Kathrin Gräve/graeve@ais.uni-bonn.de, Alex Bencz/abencz@clearpathrobotics.com
autogenerated on Mon Oct 6 2014 02:22:13