移除socket 过期代码,后面加心跳机制后再补上去
This commit is contained in:
parent
58e8c9002d
commit
d56453ebb2
@ -36,7 +36,6 @@ func newAgent(gateway IGateway, conn *websocket.Conn) *Agent {
|
|||||||
closeSignal: make(chan bool),
|
closeSignal: make(chan bool),
|
||||||
state: 1,
|
state: 1,
|
||||||
}
|
}
|
||||||
conn.SetReadDeadline(time.Now().Add(time.Minute)) //一分钟内不登录 自动断开连接
|
|
||||||
agent.wg.Add(2)
|
agent.wg.Add(2)
|
||||||
go agent.readLoop()
|
go agent.readLoop()
|
||||||
go agent.writeLoop()
|
go agent.writeLoop()
|
||||||
@ -70,7 +69,6 @@ locp:
|
|||||||
go this.Close()
|
go this.Close()
|
||||||
break locp
|
break locp
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = proto.Unmarshal(data, msg); err != nil {
|
if err = proto.Unmarshal(data, msg); err != nil {
|
||||||
this.gateway.Errorf("agent:%s uId:%s Unmarshal err:%v", this.sessionId, this.uId, err)
|
this.gateway.Errorf("agent:%s uId:%s Unmarshal err:%v", this.sessionId, this.uId, err)
|
||||||
go this.Close()
|
go this.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user