netpoll

package
v0.0.0-...-052ef2a Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetKeepAlive

func SetKeepAlive(fd, secs int) error

func SockaddrToAddr

func SockaddrToAddr(sa syscall.Sockaddr) net.Addr

SockaddrToAddr returns a go/net friendly address

Types

type Action

type Action int

Action is an action that occurs after the completion of an event.

const (
	// None indicates that no action should occur following an event.
	None Action = iota

	// Close closes the connection.
	Close

	// Shutdown shutdowns the engine.
	Shutdown
)

type Conn

type Conn[T any] struct {
	// contains filtered or unexported fields
}

type Listener

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

func OpenTCPListener

func OpenTCPListener(reusePort bool, addr string) (*Listener, error)

type Loop

type Loop[T any] struct {
	// contains filtered or unexported fields
}

func NewLoop

func NewLoop[T any](ln *Listener) (*Loop[T], error)

type Poll

type Poll[T any] struct {
	// contains filtered or unexported fields
}

Poll ...

func OpenPoll

func OpenPoll[T any]() *Poll[T]

OpenPoll ...

func (*Poll[T]) AddRead

func (p *Poll[T]) AddRead(fd int, data *T) error

AddRead ...

func (*Poll[T]) AddReadWrite

func (p *Poll[T]) AddReadWrite(fd int, data *T) error

AddReadWrite ...

func (*Poll[T]) Close

func (p *Poll[T]) Close() error

Close ...

func (*Poll[T]) ModDetach

func (p *Poll[T]) ModDetach(fd int, data *T) error

ModDetach ...

func (*Poll[T]) ModRead

func (p *Poll[T]) ModRead(fd int, data *T) error

ModRead ...

func (*Poll[T]) ModReadWrite

func (p *Poll[T]) ModReadWrite(fd int, data *T) error

ModReadWrite ...

func (*Poll[T]) Wait

func (p *Poll[T]) Wait(
	timeout time.Duration,
	onEvent func(index, count, fd int, filter int16, attachment *T) error,
	onNextWait func(count int) (time.Duration, error),
) error

Wait ...

func (*Poll[T]) Wake

func (p *Poll[T]) Wake() error

Wake ...

type Server

type Server[T any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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