listener

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 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, handlerConn HandleConnFunc) (*Listener, error)

New 创建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