]> git.mxchange.org Git - flightgear.git/blob - src/Network/props.hxx
httpd: don't spam the console with debug messages
[flightgear.git] / src / Network / props.hxx
1 // \file props.hxx
2 // Property server class.
3 //
4 // Written by Curtis Olson, started September 2000.
5 // Modified by Bernie Bright, May 2002.
6 //
7 // Copyright (C) 2000  Curtis L. Olson - http://www.flightgear.org/~curt
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 //
23 // $Id$
24
25
26 #ifndef _FG_PROPS_HXX
27 #define _FG_PROPS_HXX
28
29 #include <simgear/compiler.h>
30 #include <string>
31 #include <vector>
32
33 #include <simgear/io/sg_netChannel.hxx>
34
35 #include "protocol.hxx"
36
37 /**
38  * Property server class.
39  * This class provides a telnet-like server for remote access to
40  * FlightGear properties.
41  */
42 class FGProps : public FGProtocol,
43                 public simgear::NetChannel,
44                 public SGPropertyChangeListener // for subscriptions
45 {
46 private:
47
48     /**
49      * Server port to listen on.
50      */
51     int port;
52     simgear::NetChannelPoller poller;
53 public:
54     /**
55      * Create a new TCP server.
56      * 
57      * @param tokens Tokenized configuration parameters
58      */
59     FGProps( const std::vector<std::string>& tokens );
60
61     /**
62      * Destructor.
63      */
64     ~FGProps();
65
66     /**
67      * Start the telnet server.
68      */
69     bool open();
70
71     /**
72      * Process network activity.
73      */
74     bool process();
75
76     /**
77      * 
78      */
79     bool close();
80
81     /**
82      * Accept a new client connection.
83      */
84     void handleAccept();
85
86 };
87
88 #endif // _FG_PROPS_HXX
89