Documentation
¶
Index ¶
- Constants
- func IP6ZoneToString(zone int) string
- func ReusePortListen(proto, addr string) (net.Listener, error)
- func ReusePortListenPacket(proto, addr string) (net.PacketConn, error)
- 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) error
- func (p *Poller) AddReadWrite(fd int) error
- func (p *Poller) AddWrite(fd int) error
- func (p *Poller) Close() error
- func (p *Poller) Delete(fd int) error
- func (p *Poller) ModRead(fd int) error
- func (p *Poller) ModReadWrite(fd int) error
- func (p *Poller) Polling(callback func(fd int, ev uint32, job internal.Job) error) (err error)
- func (p *Poller) Trigger(job internal.Job) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func IP6ZoneToString ¶
IP6ZoneToString converts an IP6 Zone unix int to a net string returns "" if zone is 0
func ReusePortListen ¶
ReusePortListen returns a net.Listener for TCP.
func ReusePortListenPacket ¶
func ReusePortListenPacket(proto, addr string) (net.PacketConn, error)
ReusePortListenPacket returns a net.PacketConn for UDP.
func SetKeepAlive ¶
SetKeepAlive sets the keepalive for the connection.
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.
Types ¶
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller represents a poller which is in charge of monitoring file-descriptors.
func (*Poller) AddRead ¶
AddRead registers the given file-descriptor with readable event to the poller.
func (*Poller) AddReadWrite ¶
AddReadWrite registers the given file-descriptor with readable and writable events to the poller.
func (*Poller) AddWrite ¶
AddWrite registers the given file-descriptor with writable event to the poller.
func (*Poller) ModRead ¶
ModRead renews the given file-descriptor with readable event in the poller.
func (*Poller) ModReadWrite ¶
ModReadWrite renews the given file-descriptor with readable and writable events in the poller.