internal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventClose uint64 = 1
	EventTick  uint64 = 2
	EventWrite uint64 = 3
)

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 EventFd

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

func (*EventFd) Close

func (e *EventFd) Close() error

func (*EventFd) Fd

func (e *EventFd) Fd() int

func (*EventFd) ReadEvent

func (e *EventFd) ReadEvent() (uint64, error)

func (*EventFd) WriteEvent

func (e *EventFd) WriteEvent(val uint64) error

type EventHandler

type EventHandler interface {
	OnEvent(event uint64) error
	OnFdEvent(fd int) error
}

type Poll

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

Poll ...

func OpenPoll

func OpenPoll() *Poll

OpenPoll ...

func (*Poll) AddRead

func (p *Poll) AddRead(fd int)

AddRead ...

func (*Poll) AddReadWrite

func (p *Poll) AddReadWrite(fd int)

AddReadWrite ...

func (*Poll) Close

func (p *Poll) Close() error

Close ...

func (*Poll) FireEvent

func (p *Poll) FireEvent(event uint64) error

func (*Poll) ModDetach

func (p *Poll) ModDetach(fd int)

ModDetach ...

func (*Poll) ModRead

func (p *Poll) ModRead(fd int)

ModRead ...

func (*Poll) ModReadWrite

func (p *Poll) ModReadWrite(fd int)

ModReadWrite ...

func (*Poll) Trigger

func (p *Poll) Trigger(note interface{}) error

Trigger ...

func (*Poll) Wait

func (p *Poll) Wait(handler EventHandler) error

Wait ...

Jump to

Keyboard shortcuts

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