feat(log): 添加QQWry IP数据库支持并实现IP地址解析功能
This commit is contained in:
1
common/utils/qqwry
Submodule
1
common/utils/qqwry
Submodule
Submodule common/utils/qqwry added at 1dd385f77d
17
common/utils/tcpping.go
Normal file
17
common/utils/tcpping.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TcpPing(address string) (n int64, err error) {
|
||||
s := time.Now()
|
||||
tcpConn, err := net.Dial("tcp", address)
|
||||
n = time.Now().Sub(s).Nanoseconds()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
tcpConn.Close()
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user