Thunderbots Project
Loading...
Searching...
No Matches
threaded_udp_sender.h
1#pragma once
2
3#include <boost/asio.hpp>
4#include <boost/bind.hpp>
5#include <string>
6
7#include "software/networking/udp/udp_sender.h"
8
10{
11 public:
27 ThreadedUdpSender(const std::string& ip_address, unsigned short port,
28 const std::string& interface, bool multicast);
29
34
40 std::string getInterface() const;
41
47 std::string getIpAddress() const;
48
57 void sendString(const std::string& message, bool async = false);
58
59 private:
60 // The io_service that will be used to service all network requests
61 boost::asio::io_service io_service;
62
63 // The UdpSender that will be used to send data over the network
64 UdpSender udp_sender;
65
66 // The thread running the io_service in the background. This thread will run for the
67 // entire lifetime of the class
68 std::thread io_service_thread;
69};
Definition threaded_udp_sender.h:10
std::string getIpAddress() const
Definition threaded_udp_sender.cpp:31
void sendString(const std::string &message, bool async=false)
Definition threaded_udp_sender.cpp:36
~ThreadedUdpSender()
Definition threaded_udp_sender.cpp:12
std::string getInterface() const
Definition threaded_udp_sender.cpp:26
Definition udp_sender.h:8