YUKI Hiroshi
null+****@clear*****
Mon Jan 21 18:57:25 JST 2013
YUKI Hiroshi 2013-01-21 18:57:25 +0900 (Mon, 21 Jan 2013) New Revision: fbfcf85e66072d46726f0af707e6a39cd7c133aa https://github.com/groonga/express-kotoumi/commit/fbfcf85e66072d46726f0af707e6a39cd7c133aa Log: Create custom server internally Modified files: lib/backend-adaptor.js Modified: lib/backend-adaptor.js (+12 -1) =================================================================== --- lib/backend-adaptor.js 2013-01-21 18:39:22 +0900 (c04dc75) +++ lib/backend-adaptor.js 2013-01-21 18:57:25 +0900 (06be7df) @@ -54,7 +54,18 @@ Connection.prototype._initSender = function() { Connection.prototype._initReceiver = function() { this.hostName = this._params.hostName || DEFAULT_HOST_NAME; this.listenPort = this._params.listenPort || DEFAULT_LISTEN_PORT; - this._receiver = this._params.receiver || socketIo.listen(this.listenPort); + + var receiver = this._params.receiver; + if (!receiver) { + var server = this.listenServer; + if (!server) { + server = require('http').createServer(function() {}); + server.listen(this.listenPort); + } + receiver = socketIo.listen(server); + } + + this._receiver = receiver; this._receiver.sockets.on( 'connection', -------------- next part -------------- HTML����������������������������... Download