增加消息异常

This commit is contained in:
duanhf2012
2020-03-31 10:16:50 +08:00
parent bffc2b5f79
commit 21d763e77d
2 changed files with 3 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ const (
Sys_Event_Tcp_Connected EventType= 1 Sys_Event_Tcp_Connected EventType= 1
Sys_Event_Tcp_DisConnected EventType= 2 Sys_Event_Tcp_DisConnected EventType= 2
Sys_Event_Tcp_RecvPack EventType = 3 Sys_Event_Tcp_RecvPack EventType = 3
Sys_Event_Tcp_PackException EventType = 4
Sys_Event_User_Define EventType = 1000 Sys_Event_User_Define EventType = 1000
) )

View File

@@ -122,7 +122,8 @@ func (slf *Client) Run() {
} }
data,err:=slf.tcpService.process.Unmarshal(bytes) data,err:=slf.tcpService.process.Unmarshal(bytes)
if err != nil { if err != nil {
log.Debug("process.Unmarshal is error:%+v",err) slf.tcpService.GetEventReciver().NotifyEvent(&event.Event{Type:event.Sys_Event_Tcp_RecvPack,Data:&TcpPack{ClientId:slf.id,Data:bytes}})
//log.Debug("process.Unmarshal is error:%+v",err)
continue continue
} }