From 103a87df0b146cb8d742a65cf021500c1903f312 Mon Sep 17 00:00:00 2001 From: pengfeizhou Date: Tue, 23 Feb 2021 11:05:14 +0800 Subject: [PATCH] feat:debugger quit after client disconnected --- doric-cli/src/server.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doric-cli/src/server.ts b/doric-cli/src/server.ts index b49bd7f1..19cf1522 100644 --- a/doric-cli/src/server.ts +++ b/doric-cli/src/server.ts @@ -102,6 +102,10 @@ export async function createServer() { if (ws === client) { console.log("quit debugging"); client = undefined + debug?.send(JSON.stringify({ + type: "S2D", + cmd: "DEBUG_STOP" + } as MSG)); } }); ws.on('error', function (code: number) { @@ -115,7 +119,11 @@ export async function createServer() { } if (ws === client) { console.log("quit debugging"); - client = undefined + client = undefined; + debug?.send(JSON.stringify({ + type: "S2D", + cmd: "DEBUG_STOP" + } as MSG)); } }); });