From 41421ff9da1288aa241a5e9dcf915b685ade1c23 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sat, 16 Jun 2012 14:23:17 -0700 Subject: [PATCH] Make listenFD just DTRT after warning --- lib/net.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 2975ad4aa23..191ba3db37f 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1072,8 +1072,13 @@ Server.prototype._emitCloseIfDrained = function() { }; +var listenFDwarn = false; Server.prototype.listenFD = function(fd, type) { - throw new Error('This API is no longer supported. See child_process.fork'); + if (!listenFDwarn) { + console.error('listenFD is deprecated. Use server.listen()'); + listenFDwarn = true; + } + this.listen({ fd: fd }); }; // when sending a socket using fork IPC this function is executed