mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-14 03:50:05 +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() {
|
func (client *Client) ClientHandler() {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
if err := recover(); err != nil {
|
||||||
|
log.Printf("Client %p panic'd! %v", client, err)
|
||||||
|
}
|
||||||
client.conn.Close()
|
client.conn.Close()
|
||||||
client.server.unregister <- client
|
client.server.unregister <- client
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user