diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 392ef09c2ca3e2..7b837dbf2e3c0a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2554,12 +2554,15 @@ undocumented `COUNTER_NET_SERVER_CONNECTION()`, -Type: Runtime +Type: End-of-Life The undocumented `net._setSimultaneousAccepts()` function was originally intended for debugging and performance tuning when using the diff --git a/lib/net.js b/lib/net.js index 214b1b68b99607..7e0788556c8ef4 100644 --- a/lib/net.js +++ b/lib/net.js @@ -2473,48 +2473,9 @@ Server.prototype.unref = function() { return this; }; -let _setSimultaneousAccepts; -let warnSimultaneousAccepts = true; - -if (isWindows) { - let simultaneousAccepts; - - _setSimultaneousAccepts = function(handle) { - if (warnSimultaneousAccepts) { - process.emitWarning( - 'net._setSimultaneousAccepts() is deprecated and will be removed.', - 'DeprecationWarning', 'DEP0121'); - warnSimultaneousAccepts = false; - } - if (handle === undefined) { - return; - } - - if (simultaneousAccepts === undefined) { - simultaneousAccepts = (process.env.NODE_MANY_ACCEPTS && - process.env.NODE_MANY_ACCEPTS !== '0'); - } - - if (handle._simultaneousAccepts !== simultaneousAccepts) { - handle.setSimultaneousAccepts(!!simultaneousAccepts); - handle._simultaneousAccepts = simultaneousAccepts; - } - }; -} else { - _setSimultaneousAccepts = function() { - if (warnSimultaneousAccepts) { - process.emitWarning( - 'net._setSimultaneousAccepts() is deprecated and will be removed.', - 'DeprecationWarning', 'DEP0121'); - warnSimultaneousAccepts = false; - } - }; -} - module.exports = { _createServerHandle: createServerHandle, _normalizeArgs: normalizeArgs, - _setSimultaneousAccepts, get BlockList() { BlockList ??= require('internal/blocklist').BlockList; return BlockList; diff --git a/test/parallel/test-net-deprecated-setsimultaneousaccepts.js b/test/parallel/test-net-deprecated-setsimultaneousaccepts.js deleted file mode 100644 index dd6decdcce513f..00000000000000 --- a/test/parallel/test-net-deprecated-setsimultaneousaccepts.js +++ /dev/null @@ -1,18 +0,0 @@ -// Flags: --no-warnings -'use strict'; - -// Test that DEP0121 is emitted on the first call of _setSimultaneousAccepts(). - -const { - expectWarning -} = require('../common'); -const { - _setSimultaneousAccepts -} = require('net'); - -expectWarning( - 'DeprecationWarning', - 'net._setSimultaneousAccepts() is deprecated and will be removed.', - 'DEP0121'); - -_setSimultaneousAccepts(); diff --git a/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js b/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js deleted file mode 100644 index 391c2ecea76841..00000000000000 --- a/test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -// Test that DEP0121 is emitted only once if _setSimultaneousAccepts() is called -// more than once. This test is similar to -// test-net-deprecated-setsimultaneousaccepts.js, but that test calls -// _setSimultaneousAccepts() only once. Unlike this test, that will confirm -// that the warning is emitted on the first call. This test doesn't check which -// call caused the warning to be emitted. - -const { expectWarning } = require('../common'); -const { _setSimultaneousAccepts } = require('net'); - -expectWarning( - 'DeprecationWarning', - 'net._setSimultaneousAccepts() is deprecated and will be removed.', - 'DEP0121'); - -_setSimultaneousAccepts(); -_setSimultaneousAccepts();