mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-23 13:44:41 +08:00
优化日志
This commit is contained in:
@@ -129,7 +129,7 @@ func (slf *WSClient) Run() {
|
|||||||
for{
|
for{
|
||||||
bytes,err := slf.wsConn.ReadMsg()
|
bytes,err := slf.wsConn.ReadMsg()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug("read client id %d is error:%+v",slf.id,err)
|
log.Debug("read client id %s is error:%+v",slf.id,err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
data,err:=slf.wsService.process.Unmarshal(slf.id,bytes)
|
data,err:=slf.wsService.process.Unmarshal(slf.id,bytes)
|
||||||
@@ -153,7 +153,7 @@ func (ws *WSService) SendMsg(clientid string,msg interface{}) error{
|
|||||||
client,ok := ws.mapClient[clientid]
|
client,ok := ws.mapClient[clientid]
|
||||||
if ok == false{
|
if ok == false{
|
||||||
ws.mapClientLocker.Unlock()
|
ws.mapClientLocker.Unlock()
|
||||||
return fmt.Errorf("client %d is disconnect!",clientid)
|
return fmt.Errorf("client %s is disconnect!",clientid)
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.mapClientLocker.Unlock()
|
ws.mapClientLocker.Unlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user