mirror of https://notabug.org/acetone/ircabot.git
35 lines
861 B
C++
35 lines
861 B
C++
#ifndef TCPSYNCCLIENT_H
|
||
#define TCPSYNCCLIENT_H
|
||
|
||
#include <iostream>
|
||
#include <boost/bind/bind.hpp>
|
||
#include <boost/thread.hpp>
|
||
#include <boost/bind.hpp>
|
||
#include <boost/asio.hpp>
|
||
#include <boost/shared_ptr.hpp>
|
||
#include <boost/enable_shared_from_this.hpp>
|
||
|
||
using namespace boost::placeholders;
|
||
using boost::system::error_code;
|
||
|
||
class TcpSyncClient
|
||
{
|
||
public:
|
||
TcpSyncClient(boost::asio::ip::tcp::endpoint, boost::asio::io_service&, const std::string);
|
||
|
||
private:
|
||
template <typename T>
|
||
void log(T);
|
||
bool connect_to_server();
|
||
size_t read_complete(char*, const error_code&, size_t);
|
||
|
||
int m_already_read;
|
||
bool m_started;
|
||
char m_buff[1024]; // Буффер 1Кб
|
||
std::string m_channel;
|
||
boost::asio::ip::tcp::endpoint m_ep;
|
||
boost::asio::ip::tcp::socket m_sock;
|
||
};
|
||
|
||
#endif // TCPSYNCCLIENT_H
|