1
This commit is contained in:
@@ -17,12 +17,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var Poll *Pool
|
var Poll *Pool
|
||||||
var PrintPool map[string]*PrintPoolMap
|
|
||||||
|
//var PrintPool map[string]*PrintPoolMap
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Poll = NewPool(500)
|
Poll = NewPool(500)
|
||||||
Poll.Start()
|
Poll.Start()
|
||||||
PrintPool = make(map[string]*PrintPoolMap, 10000)
|
//PrintPool = make(map[string]*PrintPoolMap, 10000)
|
||||||
}
|
}
|
||||||
|
|
||||||
//入口
|
//入口
|
||||||
@@ -111,7 +112,7 @@ func handleConn(c net.Conn, t *TcpClient) error {
|
|||||||
heartbeat = true
|
heartbeat = true
|
||||||
}
|
}
|
||||||
|
|
||||||
obj, ok := PrintPool[printNo]
|
//obj, ok := PrintPool[printNo]
|
||||||
|
|
||||||
//证明是心跳
|
//证明是心跳
|
||||||
if heartbeat {
|
if heartbeat {
|
||||||
|
|||||||
@@ -125,10 +125,10 @@ type PrintInfo struct {
|
|||||||
StatusTime time.Time
|
StatusTime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type PrintPoolMap struct {
|
//type PrintPoolMap struct {
|
||||||
*sync.RWMutex
|
// *sync.RWMutex
|
||||||
PrintObj *TcpClient
|
// PrintObj *TcpClient
|
||||||
}
|
//}
|
||||||
|
|
||||||
//连接的客户端,吧每个客户端都放进来
|
//连接的客户端,吧每个客户端都放进来
|
||||||
type TcpClient struct {
|
type TcpClient struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user