lib: make sure close net server · nodejs/node@4d99797 · GitHub
Skip to content

Commit 4d99797

Browse files
theanarkhtargos
authored andcommitted
lib: make sure close net server
PR-URL: #51929 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 9617adc commit 4d99797

3 files changed

Lines changed: 42 additions & 2 deletions

File tree

lib/net.js

Lines changed: 13 additions & 2 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const net = require('net');
5+
// Process should exit because it does not create a real TCP server.
6+
// Paas localhost to ensure create TCP handle asynchronously because It causes DNS resolution.
7+
net.createServer().listen(0, 'localhost', common.mustNotCall()).close();
Lines changed: 22 additions & 0 deletions

0 commit comments

Comments
 (0)