28 lines
448 B
Go
28 lines
448 B
Go
|
|
package znet
|
||
|
|
|
||
|
|
import "zinx/ziface"
|
||
|
|
|
||
|
|
type Request struct {
|
||
|
|
|
||
|
|
//客户端链接
|
||
|
|
conn ziface.IConnection
|
||
|
|
|
||
|
|
//客户端的请求数据
|
||
|
|
msg ziface.IMessage
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetConnection 获取连接
|
||
|
|
func (r *Request) GetConnection() ziface.IConnection {
|
||
|
|
return r.conn
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetData 请求的消息数据
|
||
|
|
func (r *Request) GetData() []byte {
|
||
|
|
return r.msg.GetData()
|
||
|
|
}
|
||
|
|
|
||
|
|
// 获取请求消息的id
|
||
|
|
func (r *Request) GetMsgId() uint32 {
|
||
|
|
return r.msg.GetMsgId()
|
||
|
|
}
|