YUKI Hiroshi
null+****@clear*****
Tue Mar 18 16:00:54 JST 2014
YUKI Hiroshi 2014-03-18 16:00:54 +0900 (Tue, 18 Mar 2014) New Revision: 50c7c992f02cbd95103c9d9d2631107673e834ed https://github.com/droonga/express-droonga/commit/50c7c992f02cbd95103c9d9d2631107673e834ed Message: Close connections correctly Modified files: lib/droonga-protocol/receiver.js Modified: lib/droonga-protocol/receiver.js (+5 -8) =================================================================== --- lib/droonga-protocol/receiver.js 2014-03-18 14:49:40 +0900 (ea6c493) +++ lib/droonga-protocol/receiver.js 2014-03-18 16:00:54 +0900 (6f2ebbd) @@ -51,20 +51,17 @@ MsgPackReceiver.prototype.listen = function(callback) { }; MsgPackReceiver.prototype.close = function(callback) { - if (this._socket) { - this._socket.end(); - this._socket = undefined; - } + this._connections.forEach(function(connection) { + connection.socket.destroy(); + }); + this._connections = []; + if (this._server) { this._server.close(callback); - this._connections.forEach(function(connection) { - connection.socket.destroy(); - }); this._server = undefined; } else if (callback) { callback(); } - this._connections = []; this.port = undefined; }; -------------- next part -------------- HTML����������������������������...Download