listener

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleConnFunc

type HandleConnFunc func(fd int, sa unix.Sockaddr)

HandleConnFunc 处理新连接

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

Listener 监听TCP连接

func New

func New(network, addr string, reusePort bool, loop *eventloop.EventLoop, handlerConn HandleConnFunc) (*Listener, error)

New 创建Listener

func (*Listener) Close added in v0.1.10

func (l *Listener) Close() error

Close listener

func (*Listener) Fd

func (l *Listener) Fd() int

Fd Listener fd

func (*Listener) HandleEvent

func (l *Listener) HandleEvent(fd int, events poller.Event)

HandleEvent 内部使用,供 event loop 回调处理事件

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL