FlightGear next
propsProtocol.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: propsProtocol.hxx
3 * SPDX-FileComment: Property server class. Used for telnet server.
4 * SPDX-FileCopyrightText: Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
5 * SPDX-FileContributor: Modified by Bernie Bright, May 2002
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#pragma once
10
11#include <simgear/compiler.h>
12#include <string>
13#include <vector>
14
15#include <simgear/io/sg_netChannel.hxx>
16
17#include "protocol.hxx"
18
24class FGProps : public FGProtocol,
25 public simgear::NetChannel,
26 public SGPropertyChangeListener // for subscriptions
27{
28private:
29 class PropsChannel;
30
34 int port = 5501;
35 simgear::NetChannelPoller poller;
36
37 std::vector<PropsChannel*> _activeChannels;
38
39public:
45 FGProps(const std::vector<std::string>& tokens);
46
50 ~FGProps();
51
55 bool open() override;
56
60 bool process() override;
61
65 bool close() override;
66
70 void handleAccept() override;
71
72 void removeChannel(PropsChannel* channel);
73};
Props connection class.
FGProps(const std::vector< std::string > &tokens)
Create a new TCP server.
bool close() override
void removeChannel(PropsChannel *channel)
~FGProps()
Destructor.
bool open() override
Start the telnet server.
bool process() override
Process network activity.
void handleAccept() override
Accept a new client connection.