Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Add 'type' parameter to net.Server.listenFD()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pgriess authored and ry committed Jun 9, 2010
1 parent bca16a0 commit de6d663
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/net.js
Expand Up @@ -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();
};

Expand Down

0 comments on commit de6d663

Please sign in to comment.