Electron-vue, does not respond to net socket connect in click events, but it works in created. Why?

the following function is called in the click event. No callback is called, and it is normal to call it in the created of vue:

    detectNetwork(host, port, timeout=1000) {
        var net = require("net");
        console.log("detectHostPort, host:", host)
        console.log("detectHostPort, port:", port)
        console.log("detectHostPort, timeout:", timeout)
        var client = new net.Socket();
        client.setTimeout(500);
        
        console.log("detectNetwork detecting ...")
        client.connect(parseInt("8000"), "127.0.0.1", function(){
          console.log("connect, ok!!!!")
        })

        client.on("error", function(e) {
            console.log(e);
        });

        client.on("close", function() {
            console.log("Connection closed");
        });
    },
Mar.20,2021
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-1ea791e-1e68.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-1ea791e-1e68.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?