1'use strict'; 2 3const common = require('../common'); 4const net = require('net'); 5const assert = require('assert'); 6 7const socket = new net.Socket(); 8socket.setTimeout(common.platformTimeout(50)); 9 10socket.on('timeout', common.mustCall(() => { 11 assert.strictEqual(socket._handle, null); 12})); 13 14socket.on('connect', common.mustNotCall()); 15 16// Since the timeout is unrefed, the code will exit without this 17setTimeout(() => {}, common.platformTimeout(200)); 18