Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IAcceptor ¶
type IAcceptor interface { Run(fd int, loop IEventLoop) error Exit() IncrementID() int Close() }
type IConnectManager ¶
type IEventLoop ¶
type IEventLoop interface { Init(connectMgr IConnectManager) error // 初始化,也就是创建epoll Start(messageCh chan<- IRequest) // 开启事件循环,也就是所有的epoll执行epoll_wait Stop() // 停止 AddRead(conn IConnect) error Remove(conn IConnect) error }
IEventLoop 事件循环抽象层,所有的epoll都是通过这个来操作
type IPacker ¶
type IPacker interface { ReadFull(fd int) (IMessage, error) // 读包 Pack(msgID uint32, data []byte) ([]byte, error) // 封包 UnPack([]byte) (IMessage, error) // 解包 }
IPacker 数据封装抽象层
Click to show internal directories.
Click to hide internal directories.