Skip to content

Commit ace5548

Browse files
authored
net: make _setSimultaneousAccepts() end-of-life deprecated
PR-URL: #57550 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 13a9d4c commit ace5548

4 files changed

+4
-77
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2554,12 +2554,15 @@ undocumented `COUNTER_NET_SERVER_CONNECTION()`,
25542554

25552555
<!-- YAML
25562556
changes:
2557+
- version: REPLACEME
2558+
pr-url: https://github.com/nodejs/node/pull/57550
2559+
description: End-of-Life.
25572560
- version: v12.0.0
25582561
pr-url: https://github.com/nodejs/node/pull/23760
25592562
description: Runtime deprecation.
25602563
-->
25612564

2562-
Type: Runtime
2565+
Type: End-of-Life
25632566

25642567
The undocumented `net._setSimultaneousAccepts()` function was originally
25652568
intended for debugging and performance tuning when using the

lib/net.js

-39
Original file line numberDiff line numberDiff line change
@@ -2473,48 +2473,9 @@ Server.prototype.unref = function() {
24732473
return this;
24742474
};
24752475

2476-
let _setSimultaneousAccepts;
2477-
let warnSimultaneousAccepts = true;
2478-
2479-
if (isWindows) {
2480-
let simultaneousAccepts;
2481-
2482-
_setSimultaneousAccepts = function(handle) {
2483-
if (warnSimultaneousAccepts) {
2484-
process.emitWarning(
2485-
'net._setSimultaneousAccepts() is deprecated and will be removed.',
2486-
'DeprecationWarning', 'DEP0121');
2487-
warnSimultaneousAccepts = false;
2488-
}
2489-
if (handle === undefined) {
2490-
return;
2491-
}
2492-
2493-
if (simultaneousAccepts === undefined) {
2494-
simultaneousAccepts = (process.env.NODE_MANY_ACCEPTS &&
2495-
process.env.NODE_MANY_ACCEPTS !== '0');
2496-
}
2497-
2498-
if (handle._simultaneousAccepts !== simultaneousAccepts) {
2499-
handle.setSimultaneousAccepts(!!simultaneousAccepts);
2500-
handle._simultaneousAccepts = simultaneousAccepts;
2501-
}
2502-
};
2503-
} else {
2504-
_setSimultaneousAccepts = function() {
2505-
if (warnSimultaneousAccepts) {
2506-
process.emitWarning(
2507-
'net._setSimultaneousAccepts() is deprecated and will be removed.',
2508-
'DeprecationWarning', 'DEP0121');
2509-
warnSimultaneousAccepts = false;
2510-
}
2511-
};
2512-
}
2513-
25142476
module.exports = {
25152477
_createServerHandle: createServerHandle,
25162478
_normalizeArgs: normalizeArgs,
2517-
_setSimultaneousAccepts,
25182479
get BlockList() {
25192480
BlockList ??= require('internal/blocklist').BlockList;
25202481
return BlockList;

test/parallel/test-net-deprecated-setsimultaneousaccepts.js

-18
This file was deleted.

test/parallel/test-net-server-simultaneous-accepts-produce-warning-once.js

-19
This file was deleted.

0 commit comments

Comments
 (0)