28 lines
516 B
Go
28 lines
516 B
Go
package znet
|
|
|
|
import (
|
|
"go-study/zinx/ziface"
|
|
)
|
|
|
|
type Request struct {
|
|
// 已经和客户端建立好的连接
|
|
conn ziface.IConnection
|
|
// 客户端请求的数据
|
|
msg ziface.IMessage
|
|
}
|
|
|
|
// GetConnection 获取请求连接信息
|
|
func (req *Request) GetConnection() ziface.IConnection {
|
|
return req.conn
|
|
}
|
|
|
|
// GetMsgID 获取请求消息ID
|
|
func (req *Request) GetMsgID() uint32 {
|
|
return req.msg.GetMsgID()
|
|
}
|
|
|
|
// GetData 获取请求消息数据
|
|
func (req *Request) GetData() []byte {
|
|
return req.msg.GetData()
|
|
}
|