Connect event in net

operate according to the code in the nodejs playbook, and find that when a new user connects to the node server, the connect event will not be triggered
code is as follows

node version 8.12

const events = require("events");
const net = require("net");

const server = net.createServer(function(client) {
  const id = `${client.remoteAddress}:${client.remotePort}`;
  client.on("connect", function() {
    console.log(123123213);
  });

    //connection

  client.on("data", function(data) {
    console.log(data);
    data = data.toString();
  })
});
server.listen(8081);

connection code

telnet 127.0.0.1 8081
Sep.08,2021

in your callback function. There will be no connect events.

-
update:

I don't know what your book says, but
is already connected when it enters the callback, so how can it trigger connect again.

< hr >

Node.js net module documentation is not mentioned.

stackoverflow related questions and answers .

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-1e47d2f-44c59.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-1e47d2f-44c59.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?