This commit is contained in:
邹宗楠
2022-12-20 16:26:39 +08:00
parent caf21632de
commit b3bc7a22c4
2 changed files with 12 additions and 7 deletions

View File

@@ -293,6 +293,15 @@ func (t *TcpClient) addCallbackChan(key, data string) {
t.CallBackMap[key] <- data
}
func (t *TcpClient) GetCallbackChan(key string) string {
t.RLock()
defer t.RUnlock()
if t.CallBackMap[key] == nil {
return ""
}
return <-t.CallBackMap[key]
}
func (t *TcpClient) clear(key string) {
t.Lock()
defer t.Unlock()