aa
This commit is contained in:
@@ -172,6 +172,14 @@ func (t *TcpClient) buildTimeoutMap(key string) {
|
||||
t.TimeoutMap[key] = dataChan
|
||||
}
|
||||
|
||||
func (t *TcpClient) buildAllMap(key string) {
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
t.MsgMap[key] = make(chan *model.PrintMsg, 1024)
|
||||
t.CallBackMap[key] = make(chan string, 1024)
|
||||
t.TimeoutMap[key] = make(chan bool)
|
||||
}
|
||||
|
||||
func (t *TcpClient) getPrintStatus(key string) int {
|
||||
t.RLock()
|
||||
defer t.RUnlock()
|
||||
@@ -275,11 +283,11 @@ func (t *TcpClient) clear(key string) {
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
t.Clients[key].C.Close()
|
||||
delete(t.Clients, key)
|
||||
close(t.MsgMap[key])
|
||||
delete(t.MsgMap, key)
|
||||
close(t.CallBackMap[key])
|
||||
delete(t.CallBackMap, key)
|
||||
//delete(t.Clients, key)
|
||||
//close(t.MsgMap[key])
|
||||
//delete(t.MsgMap, key)
|
||||
//close(t.CallBackMap[key])
|
||||
//delete(t.CallBackMap, key)
|
||||
close(t.TimeoutMap[key])
|
||||
delete(t.TimeoutMap, key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user