diff --git a/test-rpc-server/rpc-server.js b/test-rpc-server/rpc-server.js index 2a0f450..be3d51f 100644 --- a/test-rpc-server/rpc-server.js +++ b/test-rpc-server/rpc-server.js @@ -52,8 +52,7 @@ replServer.defineCommand('kill', { const sock = global.connections[who]; if (sock) { console.log('killing', who); - sock.write(RpcMessage.sendClose(123, 'killed')); - sock.destroy(); + sock.end(RpcMessage.sendClose(123, 'killed')); } this.displayPrompt(); }