Ignore:
Timestamp:
12/23/22 09:09:50 (17 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
Message:

The C++ client API can connect over TCP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/XPlane.h

    r107 r110  
    3636
    3737#include <set>
     38#include <memory>
    3839
    3940#include <inttypes.h>
     
    4344namespace hu { namespace varadiistvan { namespace scpl { namespace io {
    4445
    45 class LocalClientSocket;
     46class BufferedStream;
    4647class DataStream;
    4748
     
    6970private:
    7071    /**
     72     * The default TCP port.
     73     */
     74    static const unsigned short defaultTCPPort = 0x5852;
     75
     76    /**
    7177     * Type for the set of multi-dataref buffers.
    7278     */
     
    7985
    8086    /**
    81      * The local client socket over which we are communicating with X-Plane.
    82      */
    83     scpl::io::LocalClientSocket* socket;
     87     * The client socket as a stream, over which we are communicating with X-Plane.
     88     */
     89    scpl::io::BufferedStream* socket;
    8490
    8591    /**
     
    108114
    109115    /**
    110      * Connect to the simulator.
     116     * Connect to the simulator locally.
    111117     */
    112118    void connect();
     119
     120    /**
     121     * Connect to the simulator on TCP to the given address.
     122     */
     123    void connectTCP(const std::string& address,
     124                    unsigned short port = defaultTCPPort);
    113125
    114126    /**
     
    363375    void setArray(const char* name, uint8_t type, size_t length,
    364376                  size_t offset);
     377
     378    /**
     379     * Connect with the given socket.
     380     */
     381    template <class ClientSocket>
     382    void connect(std::unique_ptr<ClientSocket> clientSocket);
    365383
    366384    friend class MultiBuffer;
Note: See TracChangeset for help on using the changeset viewer.