How to close the tcp connection instance created by node net

var server = net.createServer(function(connection) { 
   console.log("client connected");

   connection.on("end", function() {
      console.log("");
   });

   connection.write("Hello World!\r\n");
    
   connection.pipe(connection);

});

server.listen(8080, function() { 
  console.log("server is listening");
});

now I want to shut down connection manually. What method should I use? I have been looking for it for a long time.

Apr.24,2022

server.cloes ([callback]) , can't I close it?


connection.destroy () can be turned off

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32085-2bded.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32085-2bded.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?