diff --git a/test-rpc-server/rpc-message.js b/test-rpc-server/rpc-message.js index 051ef02..40ad3ee 100644 --- a/test-rpc-server/rpc-message.js +++ b/test-rpc-server/rpc-message.js @@ -59,7 +59,7 @@ class RpcMessage { } catch(e) { console.log(`failed to parse "${msg}"`); console.error(e); - return {}; + return {opcode: OPCODES.CLOSE, message: e.message}; } } }; diff --git a/test-rpc-server/rpc-server.js b/test-rpc-server/rpc-server.js index c10ef43..2a0f450 100644 --- a/test-rpc-server/rpc-server.js +++ b/test-rpc-server/rpc-server.js @@ -51,9 +51,11 @@ replServer.defineCommand('kill', { who = parseInt(who, 10); const sock = global.connections[who]; if (sock) { + console.log('killing', who); sock.write(RpcMessage.sendClose(123, 'killed')); - sock.end(); + sock.destroy(); } this.displayPrompt(); } }); +