#include <udp_listener.h>
|
| | UdpListener (boost::asio::io_service &io_service, const std::string &ip_address, unsigned short port, const std::string &interface, bool multicast, ReceiveCallback receive_callback) |
| |
| | UdpListener (boost::asio::io_service &io_service, const unsigned short port, ReceiveCallback receive_callback) |
| |
| virtual | ~UdpListener () |
| |
| void | close () |
| |
Creates a UDP listener that can listen on a given port and interface.
◆ UdpListener() [1/2]
| UdpListener |
( |
boost::asio::io_service & |
io_service, |
|
|
const std::string & |
ip_address, |
|
|
unsigned short |
port, |
|
|
const std::string & |
interface, |
|
|
bool |
multicast, |
|
|
ReceiveCallback |
receive_callback |
|
) |
| |
Creates a UDP listener.
- Exceptions
-
- Parameters
-
| io_service | The service thread to use for the network communication resource |
| ip_address | If multicast is true, this address is the multicast group to join. Otherwise, this is the IP address of the local interface to listen on |
| port | The port to listen on |
| interface | The networking interface to listen on |
| multicast | If true, the listener will join the multicast group given by ip_address, otherwise it will listen on the local interface given by ip_address and interface |
| receive_callback | The callback to call when a new message is received |
◆ UdpListener() [2/2]
| UdpListener |
( |
boost::asio::io_service & |
io_service, |
|
|
const unsigned short |
port, |
|
|
ReceiveCallback |
receive_callback |
|
) |
| |
Creates a UDP listener that listens on the given port on all interfaces.
A user must check the user-provided error string to see if the listener construction was successful.
- Exceptions
-
- Parameters
-
| io_service | The service thread to use for the network communication resource |
| port | The port to listen on |
| receive_callback | The callback to call when a new message is received |
◆ ~UdpListener()
◆ close()
Cleans up all associated networking resources with this listener.
The documentation for this class was generated from the following files:
- src/software/networking/udp/udp_listener.h
- src/software/networking/udp/udp_listener.cpp