MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / newWebSocketClient

Method newWebSocketClient

MiniZincIDE/server.cpp:17–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void VisConnector::newWebSocketClient(QWebSocket* socket)
18{
19 _clients << socket;
20 connect(socket, &QWebSocket::disconnected, this, &VisConnector::webSocketClientDisconnected);
21 connect(socket, &QWebSocket::textMessageReceived, this, &VisConnector::webSocketMessageReceived);
22 QJsonObject obj({{"event", "init"},
23 {"windows", _windows},
24 {"numSolutions", _solutions.isEmpty() ? 0 : _solutions.first().size()}});
25 auto json = QString::fromUtf8(QJsonDocument(obj).toJson());
26 socket->sendTextMessage(json);
27}
28
29void VisConnector::webSocketClientDisconnected()
30{

Callers

nothing calls this directly

Calls 3

firstMethod · 0.80
toJsonMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected