Ejemplo n.º 1
0
func onKeepaliveAck(session *swnet.Session, packet protocol.Packet) {
	fmt.Println("keepalive ack")
	ack := packet.(*protocol.KeepaliveAck)
	req := protocol.NewKeepalive()
	req.Token = ack.Token + 1
	req.Version = ack.Version
	session.AsyncSend(req)
}
Ejemplo n.º 2
0
func onKeepalive(session *swnet.Session, packet protocol.Packet) {
	fmt.Println("keepalive")
	req := packet.(*protocol.Keepalive)
	ack := protocol.NewKeepaliveAck()
	ack.Token = req.Token
	ack.Version = req.Version
	session.AsyncSend(ack)
}