forked from sixonionpotatoes/commons
adding client/server prototype
This commit is contained in:
29
include/client.hpp
Normal file
29
include/client.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include "boost/bind.hpp"
|
||||
#include <functional>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class client
|
||||
{
|
||||
public:
|
||||
client(boost::asio::io_service& io_service,
|
||||
const boost::asio::ip::address& multicast_address,
|
||||
short multicast_port,
|
||||
unsigned short tcp_port);
|
||||
|
||||
void init();
|
||||
void set_outbound_interface(const boost::asio::ip::address_v4& address);
|
||||
void handle_send_to(const boost::system::error_code& error);
|
||||
void handle_timeout(const boost::system::error_code& error);
|
||||
|
||||
private:
|
||||
boost::asio::ip::udp::endpoint endpoint_;
|
||||
boost::asio::ip::udp::socket socket_;
|
||||
boost::asio::deadline_timer timer_;
|
||||
std::string message_;
|
||||
unsigned short port_;
|
||||
};
|
||||
Reference in New Issue
Block a user