aboutsummaryrefslogtreecommitdiffstats
path: root/mock-server/main.cpp
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-03-23 16:39:33 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-03-23 16:39:33 +0100
commit61debe99a269bf7e87f6ba2f8d2a376e619fcf12 (patch)
tree41cf942329760f8a5f16d98ea202124fcae8a0f3 /mock-server/main.cpp
parent46e96b3318900b561928be304f4a9e252f2785a4 (diff)
downloadQtXpl2-61debe99a269bf7e87f6ba2f8d2a376e619fcf12.tar.gz
QtXpl2-61debe99a269bf7e87f6ba2f8d2a376e619fcf12.zip
Invert TCP connection model: client listens, server connects
The XPL2 protocol specifies that the JI2 controller initiates connections to the client, not the other way around. Xpl2Client now listens on 3 ports via QTcpServer and accepts inbound connections; MockServer connects out with auto-retry on the 1s KA_PING tick. QML API: startListening/stopListening, listening+connected properties, host property removed. Mock server gains --host CLI arg.
Diffstat (limited to 'mock-server/main.cpp')
-rw-r--r--mock-server/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/mock-server/main.cpp b/mock-server/main.cpp
index 5613462..9a55463 100644
--- a/mock-server/main.cpp
+++ b/mock-server/main.cpp
@@ -16,13 +16,15 @@ main (int argc, char *argv[])
QCommandLineParser parser;
parser.addOption ({ "wire-debug", "Log raw wire TX/RX to dev log" });
+ parser.addOption ({ "host", "Target host to connect to (default 127.0.0.1)",
+ "address", "127.0.0.1" });
parser.addHelpOption ();
parser.process (app);
if (parser.isSet ("wire-debug"))
MockServer::enableWireDebug ();
- new MockServer (&app);
+ new MockServer (parser.value ("host"), &app);
return app.exec ();
}