epoller

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: MIT Imports: 5 Imported by: 0

README

epoller

epoll implementation for connections in Linux, MacOS and windows.

GoDoc

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

This section is empty.

Variables

This section is empty.

Functions

func SocketFD

func SocketFD(conn net.Conn) int

Types

type Poller

type Poller interface {
	Add(conn net.Conn) error
	Remove(conn net.Conn) error
	Wait(count int) ([]net.Conn, error)
	WaitWithBuffer() ([]net.Conn, error)
	WaitChan(count int) <-chan []net.Conn
	GetConnection() map[int]net.Conn
	Close() error
}

func NewPoller

func NewPoller() (Poller, error)

func NewPollerWithBuffer

func NewPollerWithBuffer(count int) (Poller, error)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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