From de6d663a67dcec8b482e069d967ef4d1a3743c9b Mon Sep 17 00:00:00 2001 From: Peter Griess Date: Tue, 8 Jun 2010 18:09:17 -0700 Subject: [PATCH] Add 'type' parameter to net.Server.listenFD() This is needed in case the provided socket is not the default 'tcp4' type (i.e. and needs different read/write/etc methods). With this patch, one can call listenFD(sock, 'unix') to bind to existing UNIX domain sockets. --- lib/net.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 685c64b..5a480a3 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1167,12 +1167,13 @@ Server.prototype.listen = function () { } }; -Server.prototype.listenFD = function (fd) { +Server.prototype.listenFD = function (fd, type) { if (this.fd) { throw new Error('Server already opened'); } this.fd = fd; + this.type = type || null; this._startWatcher(); }; -- 2.7.4