Closed
Description
The following test will fail since the client socket will emit 'end'
and no ECONNRESET
, even though the server called destroy()
instead of end()
.
Platform: MacOS
'use strict';
const common = require('../common');
const net = require('net');
const assert = require('assert');
const server = net.createServer((socket) => {
socket.resume();
socket.on('close', common.mustCall(() => {
server.close();
}));
socket.on('end', common.mustNotCall());
socket.on('error', common.mustCall((err) => {
assert.strictEqual(err.code, 'ECONNRESET');
}));
});
server.listen(0, () => {
const req = net.connect(server.address().port);
req.resume();
req.setTimeout(10, function() {
req.destroy();
});
});