/** * @file EchoServer.h * @brief Mock XPL2 server for a single port. */ #pragma once #include #include #include class QTcpSocket; class EchoServer : public QTcpServer { Q_OBJECT public: EchoServer (quint16 port, const char *name, QObject *parent = nullptr); private slots: void onNewConnection (); void onClientMessageReady (); void onClientDisconnected (); void sendKaPing (); private: void handleCommand (QTcpSocket *client, const QByteArray &line); const char *m_name; quint16 m_port; QList m_clients; QTimer m_pingTimer; };