Documentation ¶
Overview ¶
通用的代理器
网关接收器
网关发送器:gateway->client
通用的tcp网关
通用的websocket网关
Index ¶
Constants ¶
View Source
const ( RECV_NORMAL = "recvnormal" // from client->gateway RECV_CTRL = "recvctrl" // from client->gateway SEND_NORMAL = "sendnormal" // from gateway->client SEND_CTRL = "sendctrl" // from gateway->client )
View Source
const ( SESS_AUTHFAILED = 0x4 // 认证失败 SESS_AUTHSUCCEED = 0x8 // 认证成功 )
Variables ¶
View Source
var (
ERROR_STREAM_NOT_OPEN = errors.New("stream not opened yet")
)
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) GetUserData ¶
func (agent *Agent) GetUserData() interface{}
func (*Agent) SetUserData ¶
func (agent *Agent) SetUserData(data interface{})
type Session ¶
type Session struct { MQ chan network.Data_Frame // 返回给客户端的异步消息 UserId int32 // 玩家ID Stream network.Service_StreamClient // 后端游戏服数据流 Die chan struct{} // 会话关闭信号 Flag int32 // 会话标记 ConnectTime time.Time // 链接建立时间 PacketTime time.Time // 当前包的到达时间 LastPacketTime time.Time // 上一个包到达时间 PacketCount uint32 // 对收到的包进行计数 PacketCountOneMin int // 每分钟的包统计,用于RPM判断 }
type TcpGateway ¶
type TcpGateway struct { Config string Coder network.Imessage // contains filtered or unexported fields }
func (*TcpGateway) OnDestroy ¶
func (tcp *TcpGateway) OnDestroy()
func (*TcpGateway) OnInit ¶
func (tcp *TcpGateway) OnInit()
func (*TcpGateway) Run ¶
func (tcp *TcpGateway) Run(ChClose chan bool)
Click to show internal directories.
Click to hide internal directories.