This commit is contained in:
Chris Marsh 2017-07-10 14:54:58 -07:00
parent 0de2509d2e
commit 381edef1fa
2 changed files with 4 additions and 2 deletions

View file

@ -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};
}
}
};

View file

@ -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();
}
});