listener

package
v0.0.0-...-bd135c8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 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

func (l *Listener) Close() error

Close :关闭 listener

func (*Listener) Fd

func (l *Listener) Fd() int

Fd :返回 listener 的文件句柄

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