]> git.mxchange.org Git - flightgear.git/blob - src/Network/telnet.hxx
Updated adf property names.
[flightgear.git] / src / Network / telnet.hxx
1 // \file telnet.hxx
2 // Property server class.
3 //
4 // Written by Bernie Bright, started May 2002.
5 //
6 // Copyright (C) 2002  Bernie Bright - bbright@bigpond.net.au
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22 // $Id$
23
24 #ifndef TELNET_HXX_INCLUDED
25 #define TELNET_HXX_INCLUDED 1
26
27 #include <simgear/compiler.h>
28 #include STL_STRING
29 #include <vector>
30
31 SG_USING_STD(string);
32 SG_USING_STD(vector);
33
34 #include <plib/netChannel.h>
35
36 #include "protocol.hxx"
37
38 /**
39  * Property server class.
40  * This class provides a telnet-like server for remote access to
41  * FlightGear properties.
42  */
43 class FGTelnet : public FGProtocol,
44                  public netChannel
45 {
46 private:
47
48     /**
49      * Server port to listen on.
50      */
51     int port;
52
53 public:
54     /**
55      * Create a new TCP server.
56      * 
57      * @param tokens Tokenized configuration parameters
58      */
59     FGTelnet( const vector<string>& tokens );
60
61     /**
62      * Destructor.
63      */
64     ~FGTelnet();
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 //TELNET_HXX_INCLUDED
89