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 is 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.

Author:
Kathrin Gräve

Definition at line 52 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 21 of file Socket.cpp.

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


Member Data Documentation

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

Definition at line 81 of file Socket.h.

sockaddr_in UdpMulticastSocket::m_local_addr [private]

Definition at line 79 of file Socket.h.

Definition at line 78 of file Socket.h.

const int UdpMulticastSocket::MAXRECV = 3000 [static]

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

Definition at line 57 of file Socket.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


mocap_optitrack
Author(s): Kathrin Gräve/graeve@ais.uni-bonn.de, Alex Bencz/abencz@clearpathrobotics.com
autogenerated on Tue Oct 15 2013 10:27:57