◆ ThreadedUdpSender()
| ThreadedUdpSender |
( |
const std::string & |
ip_address, |
|
|
unsigned short |
port, |
|
|
const std::string & |
interface, |
|
|
bool |
multicast |
|
) |
| |
Creates a UdpSender that sends the sendString over the network on the given address and port.
- Exceptions
-
- Parameters
-
| ip_address | The ip address to send data on (IPv4 in dotted decimal or IPv6 in hex string) example IPv4: 192.168.0.2 example IPv6: ff02::c3d0:42d2:bb8wlp4s0 (the interface is specified after %) |
| port | The port to send sendString data on |
| interface | The interface to send data on |
| multicast | If true, joins the multicast group of given ip_address |
◆ ~ThreadedUdpSender()
Destructor will stop the io_service thread
◆ getInterface()
| std::string getInterface |
( |
| ) |
const |
Get the interface that this sender is sending on.
- Returns
- The interface as a string
◆ getIpAddress()
| std::string getIpAddress |
( |
| ) |
const |
Get the IP address that this sender is sending to.
- Returns
- The IP address as a string
◆ sendString()
| void sendString |
( |
const std::string & |
message, |
|
|
bool |
async = false |
|
) |
| |
Sends a string message to the initialized ip address and port This function returns after the message has been sent.
- Parameters
-
| message | The string message to send |
| async | If true, the message will be sent asynchronously otherwise it will be send synchronously |
The documentation for this class was generated from the following files: