conn 정리시 널 체크
This commit is contained in:
@ -295,10 +295,20 @@ func (ws *WebsocketHandler) mainLoop(ctx context.Context) {
|
||||
return room
|
||||
}
|
||||
|
||||
shutdownConn := func(c *wsconn) {
|
||||
defer func() {
|
||||
r := recover()
|
||||
if r != nil {
|
||||
logger.Println(r)
|
||||
}
|
||||
}()
|
||||
ws.ClientDisconnected(c)
|
||||
c.Close()
|
||||
}
|
||||
|
||||
defer func() {
|
||||
for _, conn := range entireConns {
|
||||
ws.ClientDisconnected(conn)
|
||||
conn.Close()
|
||||
shutdownConn(conn)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user