6
#include <boost/noncopyable.hpp>
7
#include "TcpConnection.hxx"
8
#include "ConnectionManager.hxx"
9
#include "RequestHandler.hxx"
14
: private boost::noncopyable
17
/// Create the server to listen on the specified TCP address and port
18
explicit TcpServer(asio::io_service& ioService, RequestHandler& rqeuestHandler, const asio::ip::address& address, unsigned short port);
23
/// Handle completion of an asynchronous accept operation.
24
void handleAccept(const asio::error_code& e);
26
/// The io_service used to perform asynchronous operations.
27
asio::io_service& mIOService;
29
/// Acceptor used to listen for incoming connections.
30
asio::ip::tcp::acceptor mAcceptor;
32
/// The connection manager which owns all live connections.
33
ConnectionManager mConnectionManager;
35
/// The next connection to be accepted.
36
ConnectionPtr mNewConnection;
38
/// The handler for all incoming requests.
39
RequestHandler& mRequestHandler;
47
/* ====================================================================
49
Copyright (c) 2007-2008, Plantronics, Inc.
52
Redistribution and use in source and binary forms, with or without
53
modification, are permitted provided that the following conditions are
56
1. Redistributions of source code must retain the above copyright
57
notice, this list of conditions and the following disclaimer.
59
2. Redistributions in binary form must reproduce the above copyright
60
notice, this list of conditions and the following disclaimer in the
61
documentation and/or other materials provided with the distribution.
63
3. Neither the name of Plantronics nor the names of its contributors
64
may be used to endorse or promote products derived from this
65
software without specific prior written permission.
67
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
68
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
69
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
70
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
71
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
72
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
73
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
74
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
75
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
76
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
77
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
79
==================================================================== */