You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package stock
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"net"
|
|
|
|
|
"sync"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ApiMethod struct{}
|
|
|
|
|
|
|
|
|
|
// 获取天干地址
|
|
|
|
|
type GainHeavenlyEarthly struct {
|
|
|
|
|
HeavenlyStems string `json:"heavenlyStems"` //天干
|
|
|
|
|
EarthlyBranches string `json:"earthlyBranches"` //地支
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//心跳结构体
|
|
|
|
|
|
|
|
|
|
// 这是每个连接对象 每次接收到消息就会更新times为当前时间戳
|
|
|
|
|
type Session struct {
|
|
|
|
|
Id uint32
|
|
|
|
|
Con net.Conn
|
|
|
|
|
times int64
|
|
|
|
|
lock sync.Mutex
|
|
|
|
|
}
|
|
|
|
|
type SessionM struct {
|
|
|
|
|
sessions map[uint32]*Session
|
|
|
|
|
num uint32
|
|
|
|
|
lock sync.RWMutex
|
|
|
|
|
isWebSocket bool
|
|
|
|
|
// ser
|
|
|
|
|
}
|