MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / tcping

Function tcping

utils/tcping.go:49–57  ·  view source on GitHub ↗
(ipport string)

Source from the content-addressed store, hash-verified

47}
48
49func tcping(ipport string) (int64, error) {
50 t := time.Now().UnixMilli()
51 conn, err := net.DialTimeout("tcp", ipport, time.Second*10)
52 if err != nil {
53 return 9999, err
54 }
55 _ = conn.Close()
56 return time.Now().UnixMilli() - t, nil
57}

Callers 1

RunTCPPingLoopFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected