mirror of https://github.com/nodejs/node.git
net: support Server.listen(Pipe)
parent
085a09874b
commit
ddb02b978d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue