epoller

package module
v0.0.0-...-0667fee Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 5 Imported by: 1

README

epoller

epoll implementation for connections in Linux, MacOS and windows.

License GoDoc travis Go Report Card coveralls

Its target is implementing a simple epoll for connection, so you should see it only contains few methods:

type Poller interface {
	Add(conn net.Conn) error
	Remove(conn net.Conn) error
	Wait() ([]net.Conn, error)
	Close() error
}

Welcome any PRs for windows IOCompletePort.

Inspired by 1m-go-websockets.

Thanks @sunnyboy00 for providing windows implementation.

Documentation

Index

Constants

View Source
const (
	EPOLLIN      Event = unix.EPOLLIN
	EPOLLPRI           = unix.EPOLLPRI
	EPOLLOUT           = unix.EPOLLOUT
	EPOLLERR           = unix.EPOLLERR
	EPOLLHUP           = unix.EPOLLHUP
	EPOLLRDNORM        = unix.EPOLLRDNORM
	EPOLLRDBAND        = unix.EPOLLRDBAND
	EPOLLWRNORM        = unix.EPOLLWRNORM
	EPOLLWRBAND        = unix.EPOLLWRBAND
	EPOLLMSG           = unix.EPOLLMSG
	EPOLLRDHUP         = unix.EPOLLRDHUP
	EPOLLONESHOT       = unix.EPOLLONESHOT
)

Variables

This section is empty.

Functions

func GetFD

func GetFD(p unsafe.Pointer) uint64

*net.TCPListener | *net.TCPConn

Types

type Event

type Event = uint32

type Poller

type Poller interface {
	Add(conn net.Conn, fd uint64) error
	Remove(fd uint64) error
	Wait(count int) ([]net.Conn, error)
	Close(closeConns bool) error
}

func NewPoller

func NewPoller(connBufferSize int, event Event) (Poller, error)

Directories

Path Synopsis
_examples
redis-server command

Jump to

Keyboard shortcuts

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