mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-21 15:00:07 +00:00
recover client panic
This commit is contained in:
parent
115005b6a3
commit
7b60d679e4
@ -53,6 +53,9 @@ func (client *Client) Send(data interface{}, typeID uint32) {
|
||||
|
||||
func (client *Client) ClientHandler() {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
log.Printf("Client %p panic'd! %v", client, err)
|
||||
}
|
||||
client.conn.Close()
|
||||
client.server.unregister <- client
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user