blob: 3fde1cce57a3096e6d3b95620059bfdd7cc0d7ff (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#ifndef _SYNC_SERVER_H_
#define _SYNC_SERVER_H_
//#include <iostream>
//#include <string>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <asio.hpp>
#include <list>
#include "syncTcpConnection.h"
//using boost::asio::ip::tcp;
class SyncServer
{
public:
SyncServer(asio::io_service& io_service, asio::ip::tcp::endpoint tcp_endpoint );
std::list<SyncTcpConnection::pointer> conns_;
private:
void start_accept();
void handle_accept(SyncTcpConnection::pointer new_connection,
const asio::error_code& error);
asio::ip::tcp::acceptor acceptor_;
};
#endif
|