fix: panic: send on closed channel

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2022-05-12 21:45:44 +08:00
parent 65a5155e21
commit d4b8ad7ea5
+1 -2
View File
@@ -73,7 +73,6 @@ func userLoginAck(code int, c client.Client) {
func (u *user) readLoop() {
defer func() {
u.br.unregister <- u
u.conn.Close()
}()
for {
@@ -94,7 +93,7 @@ func (u *user) writeLoop() {
defer func() {
ticker.Stop()
u.conn.Close()
u.br.unregister <- u
}()
for {