diff options
author | Christian Pointner <equinox@anytun.org> | 2010-01-13 09:56:01 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2010-01-13 09:56:01 +0000 |
commit | 621f2b3fa3b6484d7ce216a18995604ca81873d1 (patch) | |
tree | 3aa185c5f45c744ba76b80336d5a54b16e39a7c2 /src/syncServer.h | |
parent | updated changelog (diff) |
added multi socket to SyncServer (better of IPv4 and IPv6)
Diffstat (limited to 'src/syncServer.h')
-rw-r--r-- | src/syncServer.h | 13 |
1 files changed, 9 insertions, 4 deletions
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<SyncTcpConnection::pointer> 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<AcceptorsElement> acceptors_; ConnectCallback onConnect_; Semaphore ready_sem_; + + void start_accept(); + void handle_accept(SyncTcpConnection::pointer new_connection, const boost::system::error_code& error, std::list<AcceptorsElement>::iterator it); }; #endif |