From ddb02b978d2b577727370b36eeb828b1a522064a Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Sat, 14 Jul 2012 09:43:10 +0200 Subject: [PATCH] net: support Server.listen(Pipe) --- lib/net.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 28e733bc13..61b103a85d 100644 --- a/lib/net.js +++ b/lib/net.js @@ -972,6 +972,7 @@ Server.prototype._listen = function() { var backlog = toNumber(arguments[1]) || toNumber(arguments[2]); var TCP = process.binding('tcp_wrap').TCP; + var Pipe = process.binding('pipe_wrap').Pipe; if (arguments.length == 0 || typeof arguments[0] == 'function') { // Bind to a random port. @@ -984,7 +985,7 @@ Server.prototype._listen = function() { } else if (h.handle) { h = h.handle; } - if (h instanceof TCP) { + if (h instanceof TCP || h instanceof Pipe) { self._handle = h; listen(self, null, -1, -1, backlog); } else if (typeof h.fd === 'number' && h.fd >= 0) {