From 621f2b3fa3b6484d7ce216a18995604ca81873d1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 13 Jan 2010 09:56:01 +0000 Subject: added multi socket to SyncServer (better of IPv4 and IPv6) --- src/syncServer.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/syncServer.h') diff --git a/src/syncServer.h b/src/syncServer.h index 3157d15..032e975 100644 --- a/src/syncServer.h +++ b/src/syncServer.h @@ -50,6 +50,7 @@ class SyncServer { public: SyncServer(std::string localaddr, std::string port, ConnectCallback onConnect); + ~SyncServer(); void onResolve(SyncTcpConnection::proto::resolver::iterator& it); void onResolvError(const std::runtime_error& e); @@ -59,14 +60,18 @@ public: std::list conns_; private: - void start_accept(); - void handle_accept(SyncTcpConnection::pointer new_connection, const boost::system::error_code& error); - Mutex mutex_; //Mutex for list conns_ boost::asio::io_service io_service_; - SyncTcpConnection::proto::acceptor acceptor_; + typedef struct { + SyncTcpConnection::proto::acceptor* acceptor_; + bool started_; + } AcceptorsElement; + std::list acceptors_; ConnectCallback onConnect_; Semaphore ready_sem_; + + void start_accept(); + void handle_accept(SyncTcpConnection::pointer new_connection, const boost::system::error_code& error, std::list::iterator it); }; #endif -- cgit v1.2.3