增加重连功能,可动态修改连接参数

This commit is contained in:
bjd
2021-01-25 16:03:33 +08:00
parent 3bb771971c
commit 9e0da33c6a
7 changed files with 26 additions and 2 deletions

View File

@@ -296,6 +296,17 @@ func CloseSess(token string) {
sess.CSess.Close()
}
func CloseCSess(token string) {
sessMux.Lock()
defer sessMux.Unlock()
sess, ok := sessions[token]
if !ok {
return
}
sess.CSess.Close()
}
func DelSessByStoken(stoken string) {
stoken = strings.TrimSpace(stoken)
sarr := strings.Split(stoken, "@")