1 #ifndef _SYNC_SERVER_H_
2 #define _SYNC_SERVER_H_
5 #include <boost/bind.hpp>
6 #include <boost/shared_ptr.hpp>
7 #include <boost/enable_shared_from_this.hpp>
8 #include <boost/function.hpp>
9 #include "threadUtils.hpp"
14 #include "syncTcpConnection.h"
16 //using boost::asio::ip::tcp;
21 SyncServer(asio::io_service
& io_service
, asio::ip::tcp::endpoint tcp_endpoint
);
22 boost::function
<void(SyncTcpConnection
*)> onConnect
;
23 std::list
<SyncTcpConnection::pointer
> conns_
;
24 void send(std::string message
);
27 void handle_accept(SyncTcpConnection::pointer new_connection
,
28 const asio::error_code
& error
);
29 Mutex mutex_
; //Mutex for list conns_
30 asio::ip::tcp::acceptor acceptor_
;