pomelo
Version:
Pomelo is a fast, scalable game server framework for [node.js](http://nodejs.org). It provides the basic development framework and many related components, including libraries and tools. Pomelo is also suitable for real-time web applications; its distri
12 lines (10 loc) • 360 B
JavaScript
var Package = require('pomelo-protocol').Package;
module.exports.handle = function(socket, reason) {
// websocket close code 1000 would emit when client close the connection
if(typeof reason === 'string') {
var res = {
reason: reason
};
socket.sendRaw(Package.encode(Package.TYPE_KICK, new Buffer(JSON.stringify(res))));
}
};