-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kick数据包类型并没有实现封装调用入口吗 #81
Comments
改造如下: 2.实现 3.回包的时候就指定回packet.Kick类型
} 这样响应客户端就能通过如下解析 @lonng 这样合理吗, 因为你源码没有一个地方实现了Kick = 0x05 回包类型。 |
Yes, Prefer type NetworkEntity interface {
Kick(v interface{}) error
} |
type NetworkEntity interface {
Kick(v interface{}) error
} // Kick message to client
func (s *Session) Kick(v interface{}) error {
return s.entity.Kick(v)
}
Kick Type = 0x04
kick, err = codec.Encode(packet.Kick, nil)
if err != nil {
panic(err)
}
func (a *agent) Kick(v interface{}) error {
if a.status() == statusClosed {
return ErrBrokenPipe
}
return a.send(pendingMessage{typ: message.Kick})
}
func(a * agent)write(){
...省略
if data.typ == message.Kick {
chWrite <- kick
break
}
...省略
}
|
Question @lonng
// Kick represents a kick off packet
Kick = 0x05 // disconnect message from server
请问这个数据包类型并没有实现吗?
源码没有一个地方调用过该类型。应该需要额外加一个类似s.Response接口来处理Kick类型的数据包吧。
客户端虽然有这个数据包类型的定义接收,但是服务端没有实现这个数据包类型的封装?
handlers[Package.TYPE_KICK] = onKick;
The text was updated successfully, but these errors were encountered: