This commit is contained in:
suyl
2021-07-29 18:25:00 +08:00
parent b18672e92d
commit 37440aa104
2 changed files with 12 additions and 4 deletions

View File

@@ -102,6 +102,7 @@ var (
printMsgChan = make(chan *model.PrintMsg, 1024)
//printMsgCallbackMap = make(map[string]chan string, 1024)
printMsgChanFail = make(chan *model.PrintMsg, 1024)
timeoutChan = make(chan int, 10)
)
type PrintInfo struct {
@@ -144,8 +145,11 @@ func (t *TcpClient) addConn(c net.Conn, key string, status int) {
}
func (t *TcpClient) buildCallBackMap(key string) {
t.Lock()
defer t.Unlock()
dataChan := make(chan string, 1024)
t.CallBackMap[key] = dataChan
timeoutChan <- 1
}
func (t *TcpClient) getPrintStatus(key string) int {