mirror of https://notabug.org/acetone/ircabot.git
TcpSyncClient
parent
ee1e105052
commit
6e7cff971e
|
@ -0,0 +1,16 @@
|
|||
TEMPLATE = app
|
||||
CONFIG += console c++11
|
||||
CONFIG -= app_bundle
|
||||
CONFIG -= qt
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
tcpsyncclient.cpp
|
||||
|
||||
HEADERS += \
|
||||
tcpsyncclient.h
|
||||
|
||||
LIBS += \
|
||||
-lboost_system-mt \
|
||||
-lws2_32
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#include <iostream>
|
||||
#include "tcpsyncclient.h"
|
||||
|
||||
void usage(std::string argv)
|
||||
{
|
||||
std::cout << argv << " <address> <port>" << std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
if (argc < 2) usage( std::string(argv[0]));
|
||||
|
||||
boost::asio::io_service service;
|
||||
TcpSyncClient( std::string(argv[1]), std::string(argv[2]));
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#include "tcpsyncclient.h"
|
||||
|
||||
TcpSyncClient::TcpSyncClient(std::string a, std::string p) : m_address(a), m_port(p)
|
||||
{
|
||||
this->displayConfig();
|
||||
}
|
||||
|
||||
void TcpSyncClient::displayConfig()
|
||||
{
|
||||
std::cout << "Address: " << m_address << std::endl;
|
||||
std::cout << "Port: " << m_port << std::endl;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
#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;
|
||||
|
||||
class TcpSyncClient
|
||||
{
|
||||
public:
|
||||
TcpSyncClient(std::string a, std::string p);
|
||||
|
||||
private:
|
||||
void displayConfig();
|
||||
|
||||
std::string m_address;
|
||||
std::string m_port;
|
||||
};
|
||||
|
||||
#endif // TCPSYNCCLIENT_H
|
Loading…
Reference in New Issue