11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst net = require('net'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciconst server = net.createServer(); 61cb0ef41Sopenharmony_ciserver.listen(0); 71cb0ef41Sopenharmony_ciconst port = server.address().port; 81cb0ef41Sopenharmony_ciconst conn = net.createConnection(port); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciconn.on('error', common.mustCall(() => { 111cb0ef41Sopenharmony_ci conn.resetAndDestroy(); 121cb0ef41Sopenharmony_ci})); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ciconn.on('close', common.mustCall()); 151cb0ef41Sopenharmony_ciserver.close(); 16