internal

package
v0.0.0-...-7a23388 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PollInitSize = 1024
	PollMaxSize  = 8192
)

event poll size

View Source
const (
	CmdStop byte = 0x0
	CmdUser byte = 0x1
)

Variables

View Source
var ErrKTLSUnsupported = errors.New("ktls unsupported")

Functions

func SockaddrToAddr

func SockaddrToAddr(sa unix.Sockaddr) net.Addr

SockaddrToAddr returns a go/net friendly address

func SystemSupportKTLS

func SystemSupportKTLS() (bool, error)

SystemSupportKTLS reports whether the current system likely supports Linux kTLS. It checks for the tls kernel module and tries enabling the TCP ULP "tls" on a connected socket.

Types

type Event

type Event uint32

Event poller 返回事件

const (
	EventNone Event = 0x0
	EventStop Event = 0xff
	EventIdle Event = 0xfe

	EventRead  Event = 0x1
	EventWrite Event = 0x2
	EventErr   Event = 0x80
)

Event poller 返回事件值

type Fakelock

type Fakelock struct{}

func (*Fakelock) Lock

func (l *Fakelock) Lock()

func (*Fakelock) Unlock

func (l *Fakelock) Unlock()

type Poll

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

Poll ...

func OpenPoll

func OpenPoll(id int) *Poll

OpenPoll ...

func (*Poll) AddRead

func (p *Poll) AddRead(fd int) error

AddRead ...

func (*Poll) AddReadWrite

func (p *Poll) AddReadWrite(fd int) error

AddReadWrite ...

func (*Poll) Close

func (p *Poll) Close() error

Close ...

func (*Poll) Del

func (p *Poll) Del(fd int) error

Del ...

func (*Poll) ModRead

func (p *Poll) ModRead(fd int) error

ModRead ...

func (*Poll) ModReadWrite

func (p *Poll) ModReadWrite(fd int) error

ModReadWrite ...

func (*Poll) Poll

func (p *Poll) Poll(handler func(fd int, event Event))

Poll ...

func (*Poll) SetPollWait

func (p *Poll) SetPollWait(msec int)

SetPollWait ...

func (*Poll) Trigger

func (p *Poll) Trigger(cmd byte) error

Trigger ...

type Spinlock

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

func (*Spinlock) Lock

func (l *Spinlock) Lock()

func (*Spinlock) Unlock

func (l *Spinlock) Unlock()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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