Documentation ¶
Index ¶
- func NewConnection(conn *net.TCPConn, connID uint32, msgHandler ziface.IMsgHandle) ziface.IConnection
- func NewServer(name string) ziface.IServer
- type BaseRoute
- type Connection
- func (c *Connection) GetConnID() uint32
- func (c *Connection) GetTCPConnection() *net.TCPConn
- func (c *Connection) RemoteAddr() net.Addr
- func (c *Connection) SendMsg(msgId uint32, data []byte) error
- func (c *Connection) Start()
- func (c *Connection) StartReader()
- func (c *Connection) StartWriter()
- func (c *Connection) Stop()
- type DataPack
- type Message
- type MsgHandler
- func (s *MsgHandler) AddRoute(msgId uint32, route ziface.IRoute)
- func (s *MsgHandler) DoMsgHandler(request ziface.IRequest)
- func (s *MsgHandler) SendMsgToTaskQueue(request ziface.IRequest)
- func (s *MsgHandler) StartOneWorker(workerID int, taskQueue chan ziface.IRequest)
- func (s *MsgHandler) StartWorkerPool()
- type Request
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(conn *net.TCPConn, connID uint32, msgHandler ziface.IMsgHandle) ziface.IConnection
Types ¶
type BaseRoute ¶
type BaseRoute struct{}
func (BaseRoute) PostHandler ¶
func (*BaseRoute) PreHandler ¶
type Connection ¶
type Connection struct { Conn *net.TCPConn ConnID uint32 ExitBuffChan chan bool MsgHandler ziface.IMsgHandle // contains filtered or unexported fields }
func (*Connection) GetConnID ¶
func (c *Connection) GetConnID() uint32
func (*Connection) GetTCPConnection ¶
func (c *Connection) GetTCPConnection() *net.TCPConn
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() net.Addr
func (*Connection) Start ¶
func (c *Connection) Start()
func (*Connection) StartReader ¶
func (c *Connection) StartReader()
func (*Connection) StartWriter ¶
func (c *Connection) StartWriter()
func (*Connection) Stop ¶
func (c *Connection) Stop()
type DataPack ¶
type DataPack struct { }
func NewDataPack ¶
func NewDataPack() *DataPack
func (*DataPack) GetHeadLen ¶
type MsgHandler ¶
type MsgHandler struct { Apis map[uint32]ziface.IRoute WorkerPoolSize uint32 TaskQueue []chan ziface.IRequest }
func NewMsgHandle ¶
func NewMsgHandle() *MsgHandler
func (*MsgHandler) DoMsgHandler ¶
func (s *MsgHandler) DoMsgHandler(request ziface.IRequest)
func (*MsgHandler) SendMsgToTaskQueue ¶
func (s *MsgHandler) SendMsgToTaskQueue(request ziface.IRequest)
func (*MsgHandler) StartOneWorker ¶
func (s *MsgHandler) StartOneWorker(workerID int, taskQueue chan ziface.IRequest)
func (*MsgHandler) StartWorkerPool ¶
func (s *MsgHandler) StartWorkerPool()
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) GetConnection ¶
func (r *Request) GetConnection() ziface.IConnection
Click to show internal directories.
Click to hide internal directories.