mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 07:40:16 +00:00

Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
22 lines
609 B
JavaScript
22 lines
609 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
const server = net.createServer(common.mustCall(function(socket) {
|
|
assert.strictEqual(socket.localAddress, common.localhostIPv4);
|
|
assert.strictEqual(socket.localPort, this.address().port);
|
|
socket.on('end', function() {
|
|
server.close();
|
|
});
|
|
socket.resume();
|
|
}));
|
|
|
|
server.listen(0, common.localhostIPv4, function() {
|
|
const client = net.createConnection(this.address()
|
|
.port, common.localhostIPv4);
|
|
client.on('connect', function() {
|
|
client.end();
|
|
});
|
|
});
|