1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-14 23:33:35 +00:00

Added ping/pong support.

This commit is contained in:
Ylian Saint-Hilaire
2021-07-02 11:05:19 -07:00
parent 472881222a
commit 605369af87
2 changed files with 37 additions and 2 deletions

View File

@@ -213,6 +213,17 @@ namespace MeshCentralRouter
string action = jsonAction["action"].ToString();
switch (action)
{
case "pong":
{
// NOP
break;
}
case "ping":
{
// Send pong back
if (wc != null) { wc.WriteStringWebSocket("{\"action\":\"pong\"}"); }
break;
}
case "close":
{
disconnectCause = jsonAction["cause"].ToString();