Documentation ¶
Index ¶
- type AcceptEventHook
- type Ctx
- func (object *Ctx) AcceptEvent(fd int, addr unix.Sockaddr) bool
- func (object *Ctx) Close()
- func (object *Ctx) GetID() int32
- func (object *Ctx) GetPort() int
- func (object *Ctx) GetV4IP() string
- func (object *Ctx) IsReadShutdown() bool
- func (object *Ctx) IsWriteShutdown() bool
- func (object *Ctx) ReadEvent()
- func (object *Ctx) SetOption(options ...CtxOption) *Ctx
- func (object *Ctx) ShutdownSocket(readOrWrite bool)
- func (object *Ctx) Write(buf *byte_buf.ByteBuf)
- func (object *Ctx) WriteEvent(buf *byte_buf.ByteBuf, err error)
- type CtxFactory
- type CtxOption
- func CtxAcceptEventHookOption(hook AcceptEventHook) CtxOption
- func CtxBufferSizeOption(size int) CtxOption
- func CtxEventLoopOption(eventLoop *EventLoop) CtxOption
- func CtxIDOption(id int32) CtxOption
- func CtxReadEventHookOption(hook ReadEventHook) CtxOption
- func CtxWriteEventHookOption(hook WriteEventHook) CtxOption
- type EventLoop
- type EventLoopOption
- type ReadEventHook
- type WriteEventHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ctx ¶
Ctx 处理器
func (*Ctx) AcceptEvent ¶
AcceptEvent 接受
func (*Ctx) ShutdownSocket ¶
ShutdownSocket 关闭socket
type CtxOption ¶
type CtxOption func(ctx *Ctx)
CtxOption 上下文选项
func CtxAcceptEventHookOption ¶
func CtxAcceptEventHookOption(hook AcceptEventHook) CtxOption
CtxAcceptEventHookOption 接受事件钩子选项
func CtxEventLoopOption ¶
CtxEventLoopOption EventLoop选项
func CtxReadEventHookOption ¶
func CtxReadEventHookOption(hook ReadEventHook) CtxOption
CtxReadEventHookOption 读取事件钩子选项
func CtxWriteEventHookOption ¶
func CtxWriteEventHookOption(hook WriteEventHook) CtxOption
CtxWriteEventHookOption 写事件钩子选项
type EventLoop ¶
type EventLoop struct {
// contains filtered or unexported fields
}
EventLoop 事件循环
func (*EventLoop) Listen ¶
func (object *EventLoop) Listen(port int, options ...EventLoopOption, ) (err error)
Listen 侦听
func (*EventLoop) SetCtxFactory ¶
func (object *EventLoop) SetCtxFactory(factory CtxFactory) *EventLoop
SetCtxFactory 设置Ctx工厂
type EventLoopOption ¶
type EventLoopOption func(object *EventLoop)
EventLoopOption 事件循环选项
func EventLoopBacklogOption ¶
func EventLoopBacklogOption(backlog int) EventLoopOption
EventLoopBacklogOption 完成队列长度选项
type WriteEventHook ¶
WriteEventHook 写事件钩子
Click to show internal directories.
Click to hide internal directories.