goselect

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: GPL-3.0, MIT Imports: 2 Imported by: 0

README

go-select

select(2) implementation in Go

Supported platforms

386 amd64 arm arm64
linux yes yes yes yes
darwin yes yes n/a ??
freebsd yes yes yes ??
openbsd yes yes yes ??
netbsd yes yes yes ??
dragonfly n/a yes n/a ??
solaris n/a no n/a ??
plan9 no no n/a ??
windows yes yes n/a ??
android n/a n/a no ??

*n/a: platform not supported by Go

Go on plan9 and solaris do not implement syscall.Select not syscall.SYS_SELECT.

Cross compile

Using davecheney's https://github.com/davecheney/golang-crosscompile

export PLATFORMS="darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64 openbsd/386 openbsd/amd64 netbsd/386 netbsd/amd64 dragonfly/amd64 plan9/386 plan9/amd64 solaris/amd64"

Documentation

Index

Constants

View Source
const FD_SETSIZE = syscall.FD_SETSIZE
View Source
const (
	// NFDBITS is the amount of bits per mask
	NFDBITS = 8 * 8
)

Variables

This section is empty.

Functions

func RetrySelect

func RetrySelect(n int, r, w, e *FDSet, timeout time.Duration, retries int, retryDelay time.Duration) (err error)

RetrySelect wraps syscall.Select with Go types, and retries a number of times, with a given retryDelay.

func Select

func Select(n int, r, w, e *FDSet, timeout time.Duration) error

Select wraps syscall.Select with Go types

Types

type FDSet

type FDSet syscall.FdSet

FDSet wraps syscall.FdSet with convenience methods

func (*FDSet) Clear

func (fds *FDSet) Clear(fd uintptr)

Clear remove the fd from the set

func (*FDSet) IsSet

func (fds *FDSet) IsSet(fd uintptr) bool

IsSet check if the given fd is set

func (*FDSet) Set

func (fds *FDSet) Set(fd uintptr)

Set adds the fd to the set

func (*FDSet) Zero

func (fds *FDSet) Zero()

Zero empties the Set

Jump to

Keyboard shortcuts

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