testing
This commit is contained in:
parent
0de2509d2e
commit
381edef1fa
2 changed files with 4 additions and 2 deletions
|
@ -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};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue