修改
This commit is contained in:
@@ -25,9 +25,8 @@ type Cmd struct {
|
||||
//Res reflect.Value //返回体
|
||||
}
|
||||
|
||||
var CmdCache = make(map[uint32]Cmd, 0)
|
||||
var (
|
||||
CmdCache = &utils.SyncMap[uint32, Cmd]{} //命令缓存
|
||||
|
||||
Logger = glog.New()
|
||||
Cron = cronex.New() //时间轮
|
||||
|
||||
|
||||
@@ -8,7 +8,10 @@ import (
|
||||
func TcpPing(address string) (n int64, err error) {
|
||||
s := time.Now()
|
||||
tcpConn, err := net.Dial("tcp", address)
|
||||
n = time.Now().Sub(s).Nanoseconds()
|
||||
n = time.Now().Sub(s).Milliseconds()
|
||||
if n == 0 {
|
||||
n = 1
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user