Documentation ¶
Index ¶
- type Client
- type ConnCallback
- type Connection
- type Server
- func (s *Server) CallOnConnStart(conn *Connection)
- func (s *Server) CallOnConnStop(conn *Connection)
- func (s *Server) GetRouter() *gnet.Router
- func (s *Server) Run()
- func (s *Server) SetOnConnStart(connCallback ConnCallback)
- func (s *Server) SetOnConnStop(connCallback ConnCallback)
- func (s *Server) Start()
- func (s *Server) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) StartConsoleReader ¶
func (c *Client) StartConsoleReader()
func (*Client) StartTcpReader ¶
func (c *Client) StartTcpReader()
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(server *Server, conn *net.TCPConn, connID uint32) *Connection
NewConnection 创建新的链接对象
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() net.Addr
func (*Connection) Start ¶
func (c *Connection) Start()
func (*Connection) StartReader ¶
func (c *Connection) StartReader()
StartReader StartTcpReader 读消息Goroutine,用于从客户端中读取数据
func (*Connection) Stop ¶
func (c *Connection) Stop()
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 定义一个Server服务类,实现interfaces.IServer接口
func (*Server) CallOnConnStart ¶
func (s *Server) CallOnConnStart(conn *Connection)
CallOnConnStart 调用连接OnConnStart Hook函数
func (*Server) CallOnConnStop ¶
func (s *Server) CallOnConnStop(conn *Connection)
CallOnConnStop 调用连接OnConnStop Hook函数
func (*Server) SetOnConnStart ¶
func (s *Server) SetOnConnStart(connCallback ConnCallback)
SetOnConnStart 设置服务器有新的链接Hook函数
func (*Server) SetOnConnStop ¶
func (s *Server) SetOnConnStop(connCallback ConnCallback)
SetOnConnStop 设置服务器有链接断开Hook函数
Click to show internal directories.
Click to hide internal directories.