listener

package
Version: v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 7 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

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 回调处理事件

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL