11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst net = require('net'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciconst server = net.createServer(common.mustCall(function(s) { 71cb0ef41Sopenharmony_ci server.close(); 81cb0ef41Sopenharmony_ci s.end(); 91cb0ef41Sopenharmony_ci})).listen(0, '127.0.0.1', common.mustCall(function() { 101cb0ef41Sopenharmony_ci const socket = net.connect(this.address().port, '127.0.0.1'); 111cb0ef41Sopenharmony_ci socket.on('end', common.mustCall(() => { 121cb0ef41Sopenharmony_ci assert.strictEqual(socket.writable, true); 131cb0ef41Sopenharmony_ci socket.write('hello world'); 141cb0ef41Sopenharmony_ci })); 151cb0ef41Sopenharmony_ci})); 16