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