diff options
Diffstat (limited to 'mock-server/MockServer.h')
| -rw-r--r-- | mock-server/MockServer.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mock-server/MockServer.h b/mock-server/MockServer.h index 21d4d32..13bb2cd 100644 --- a/mock-server/MockServer.h +++ b/mock-server/MockServer.h @@ -17,11 +17,13 @@ class MockServer : public QObject public: explicit MockServer (QObject *parent = nullptr); + static void enableWireDebug (); private slots: void onNewConnection (); void onClientMessageReady (); void onClientDisconnected (); + /* Send KA_PING keepalive to all connected clients. */ void sendKaPing (); private: @@ -33,12 +35,18 @@ private: }; void setupPort (Port &port, const char *name, quint16 number); - const char *portName (quint16 localPort) const; + /* Return a fixed-width "[Name:port]" tag for log lines. */ + QString logTag (quint16 localPort) const; + /* Parse incoming line, log RX, and dispatch to the matching handler. */ void handleCommand (QTcpSocket *client, const QByteArray &line); + void sendReply (QTcpSocket *client, const QByteArray &data); + void handleKaPing (QTcpSocket *client, const QByteArray ¶ms); + void handleGsJcVersion (QTcpSocket *client); Port m_command; Port m_imaging; Port m_status; QList<QTcpSocket *> m_clients; QTimer m_pingTimer; + static bool s_wireDebug; }; |
