OSDN Git Service

ソースツリー再構成中(ほぼOK?)
[ultramonkey-l7/ultramonkey-l7-v3.git] / l7vsd / include / command_receiver.h
1 /*!
2  *      @file   command_receiver.h
3  *      @brief  l7vsadm message receiver class
4  *
5  * L7VSD: Linux Virtual Server for Layer7 Load Balancing
6  * Copyright (C) 2009  NTT COMWARE Corporation.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  **********************************************************************/
24
25 #ifndef COMMAND_RECEIVER_H
26 #define COMMAND_RECEIVER_H
27
28 #include <boost/asio.hpp>
29 #include <boost/utility.hpp>
30 #include "command_session.h"
31 #include "l7vsd.h"
32
33 namespace l7vs{
34 class   l7vsd;
35 class   command_session;
36
37 //!     @class  command_receiver
38 //!     @brief  l7vsadm message receiver class
39 class   command_receiver : private boost::noncopyable{
40 protected:
41         //! io dispatcher
42         boost::asio::io_service&                                                dispatcher;
43         //! acceptor
44         boost::asio::local::stream_protocol::acceptor   acceptor_;
45         //! l7vsd refference
46         l7vsd&                                                                                  vsd;
47         //! socketfile
48         std::string                                                             sockfile;
49
50         //!     @brief          accept handler
51         //!     @param[in]      command session
52         //!     @param[in]      error code
53         void    handle_accept( boost::shared_ptr<command_session>, const boost::system::error_code& );
54
55 public:
56         //!     @brief          constructor
57         //!     @param[in]      io_service
58         //!     @param[in]      socket file
59         //!     @param[in]      l7vsd refernce
60         command_receiver(       boost::asio::io_service&, const std::string&, l7vsd& );
61
62         //!     @brief          destructor
63         ~command_receiver();
64 };
65
66 };      //namespace l7vsd
67 #endif  //COMMAND_RECEIVER_H