Documentation
¶
Index ¶
- func CeilToPowerOfTwo(n int) int
- func FloorToPowerOfTwo(n int) int
- func IP6ZoneToString(zone int) string
- func Identity(n int) int
- func IsPowerOfTwo(n int) bool
- func LogarithmicRange(min, max int, cb func(int))
- func SetKeepAlive(fd, secs int) error
- func SockaddrToIPAndZone(sa unix.Sockaddr) (net.IP, string)
- func SockaddrToTCPOrUnixAddr(sa unix.Sockaddr) net.Addr
- func SockaddrToUDPAddr(sa unix.Sockaddr) *net.UDPAddr
- func SockaddrToUnixAddr(sa unix.Sockaddr) *net.UnixAddr
- type Poller
- func (p *Poller) AddRead(fd int)
- func (p *Poller) AddReadWrite(fd int)
- func (p *Poller) Close() error
- func (p *Poller) ModDetach(fd int)
- func (p *Poller) ModRead(fd int)
- func (p *Poller) ModReadWrite(fd int)
- func (p *Poller) Polling(iter func(fd int, note interface{}) error) error
- func (p *Poller) Trigger(note interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CeilToPowerOfTwo ¶
CeilToPowerOfTwo returns the least power of two integer value greater than or equal to n.
func FloorToPowerOfTwo ¶
FloorToPowerOfTwo returns the greatest power of two integer value less than or equal to n.
func IP6ZoneToString ¶
IP6ZoneToString converts an IP6 Zone unix int to a net string returns "" if zone is 0
func IsPowerOfTwo ¶
IsPowerOfTwo reports whether given integer is a power of two.
func LogarithmicRange ¶
LogarithmicRange iterates from ceiled to power of two min to max, calling cb on each iteration.
func SockaddrToIPAndZone ¶
SockaddrToIPAndZone converts a Sockaddr to a net.IP (with optional IPv6 Zone) Returns nil if conversion fails.
func SockaddrToTCPOrUnixAddr ¶
SockaddrToTCPOrUnixAddr converts a Sockaddr to a net.TCPAddr or net.UnixAddr. Returns nil if conversion fails.
func SockaddrToUDPAddr ¶
SockaddrToUDPAddr converts a Sockaddr to a net.UDPAddr Returns nil if conversion fails.