From fae209a9e93400c3a2072befda9c820634cf9278 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 25 Dec 2010 12:54:59 +0100 Subject: Restructured repository. --- src/tcpserver.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/tcpserver.h (limited to 'src/tcpserver.h') diff --git a/src/tcpserver.h b/src/tcpserver.h new file mode 100644 index 0000000..47c5056 --- /dev/null +++ b/src/tcpserver.h @@ -0,0 +1,27 @@ +#ifndef TCPSERVER_H +#define TCPSERVER_H + +#include +#include + +#include "connection.h" + +class TCPServer { + private: + boost::asio::ip::tcp::acceptor acceptor_; + + boost::function connect_callback; + + //! Listen for incoming connection. + void listen(); + + //! Handle new connection. + void handle_connection(Connection::p connection, const boost::system::error_code& error); + + public: + TCPServer(boost::asio::io_service& io_service); + + void get_connection(boost::function f); +}; + +#endif -- cgit v1.2.3