mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
536 B
26 lines
536 B
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
const uv = process.binding('uv');
|
|
|
|
const s = new net.Socket({
|
|
handle: {
|
|
readStart: function() {
|
|
process.nextTick(() => this.onread(uv.UV_EOF, null));
|
|
},
|
|
close: (cb) => process.nextTick(cb)
|
|
},
|
|
writable: false
|
|
});
|
|
s.resume();
|
|
|
|
const events = [];
|
|
|
|
s.on('end', () => events.push('end'));
|
|
s.on('close', () => events.push('close'));
|
|
|
|
process.on('exit', () => {
|
|
assert.deepStrictEqual(events, [ 'end', 'close' ]);
|
|
});
|
|
|