Browse Source

net: support Server.listen(Pipe)

v0.9.1-release
Andreas Madsen 13 years ago
committed by isaacs
parent
commit
ddb02b978d
  1. 3
      lib/net.js

3
lib/net.js

@ -972,6 +972,7 @@ Server.prototype._listen = function() {
var backlog = toNumber(arguments[1]) || toNumber(arguments[2]); var backlog = toNumber(arguments[1]) || toNumber(arguments[2]);
var TCP = process.binding('tcp_wrap').TCP; var TCP = process.binding('tcp_wrap').TCP;
var Pipe = process.binding('pipe_wrap').Pipe;
if (arguments.length == 0 || typeof arguments[0] == 'function') { if (arguments.length == 0 || typeof arguments[0] == 'function') {
// Bind to a random port. // Bind to a random port.
@ -984,7 +985,7 @@ Server.prototype._listen = function() {
} else if (h.handle) { } else if (h.handle) {
h = h.handle; h = h.handle;
} }
if (h instanceof TCP) { if (h instanceof TCP || h instanceof Pipe) {
self._handle = h; self._handle = h;
listen(self, null, -1, -1, backlog); listen(self, null, -1, -1, backlog);
} else if (typeof h.fd === 'number' && h.fd >= 0) { } else if (typeof h.fd === 'number' && h.fd >= 0) {

Loading…
Cancel
Save