Line data Source code
1 : // Copyright (c) 2012-2019 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // This program is free software; you can redistribute it and/or modify
4 : // it under the terms of the GNU General Public License as published by
5 : // the Free Software Foundation; either version 2 of the License, or
6 : // (at your option) any later version.
7 : //
8 : // This program is distributed in the hope that it will be useful,
9 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 : // GNU General Public License for more details.
12 : //
13 : // You should have received a copy of the GNU General Public License
14 : // along with this program; if not, write to the Free Software
15 : // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 : #pragma once
17 :
18 : // self
19 : //
20 : #include "eventdispatcher/connection_with_send_message.h"
21 : #include "eventdispatcher/dispatcher_support.h"
22 : #include "eventdispatcher/tcp_server_client_buffer_connection.h"
23 :
24 :
25 :
26 : namespace ed
27 : {
28 :
29 :
30 :
31 0 : class tcp_server_client_message_connection
32 : : public tcp_server_client_buffer_connection
33 : , public dispatcher_support
34 : , public connection_with_send_message
35 : {
36 : public:
37 : typedef std::shared_ptr<tcp_server_client_message_connection> pointer_t;
38 :
39 : tcp_server_client_message_connection(tcp_bio_client::pointer_t client);
40 :
41 : std::string const & get_remote_address() const;
42 :
43 : // connection_with_send_message
44 : virtual bool send_message(message const & msg, bool cache = false) override;
45 :
46 : // snap_tcp_server_client_buffer_connection implementation
47 : virtual void process_line(std::string const & line) override;
48 :
49 : private:
50 : std::string f_remote_address = std::string();
51 : };
52 :
53 :
54 :
55 : } // namespace ed
56 : // vim: ts=4 sw=4 et
|