Public Member Functions

SCS::UDPReceiver Class Reference

Receive UDP packets from IP address and port. The receiver is multicast aware. More...

#include <udpreceiver.h>

List of all members.

Public Member Functions

 UDPReceiver (boost::function< void(void *, std::size_t)> function, boost::asio::io_service &io_service, const boost::asio::ip::address &address, short port)
 ~UDPReceiver ()

Detailed Description

Receive UDP packets from IP address and port. The receiver is multicast aware.

If the address provided belongs to the IP multicast range, the multicast group is automatically joined, else it is handled as unicast.

Author:
(c) 2009 by Philipp Münzel
Version:
1.3

Constructor & Destructor Documentation

SCS::UDPReceiver::UDPReceiver ( boost::function< void(void *, std::size_t)>  function,
boost::asio::io_service &  io_service,
const boost::asio::ip::address &  address,
short  port 
)

Open a socket and listen asynchronously to incoming data.

Parameters:
functionfunction to parse incoming data, takes a raw pointer to data and size in bytes
io_servicea boost::asio::io_service to handle the asynchronous requests
addressip address struct
portport from which data is received
SCS::UDPReceiver::~UDPReceiver ( )

Stop receiving data and close connection.


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