Documentation
¶
Index ¶
- Constants
- func SetKeepAlive(fd, secs int) error
- func SocketAddrToTCPOrUnixAddr(sa unix.Sockaddr) net.Addr
- func SocketAddrToUDPAddr(sa unix.Sockaddr) *net.UDPAddr
- type Poller
- func (p *Poller) AddRead(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) error) (err error)
- func (p *Poller) Trigger(w asyncwork.Work) error
Constants ¶
View Source
const ( // InitEvents represents the initial length of poller event-list. InitEvents = 128 // ErrEvents represents exceptional events that are not read/write, like socket being closed, // reading/writing from/to a closed socket, etc. ErrEvents = unix.EPOLLERR | unix.EPOLLHUP | unix.EPOLLRDHUP // OutEvents combines EPOLLOUT event and some exceptional events. OutEvents = ErrEvents | unix.EPOLLOUT // InEvents combines EPOLLIN/EPOLLPRI events and some exceptional events. InEvents = ErrEvents | unix.EPOLLIN | unix.EPOLLPRI )
Variables ¶
This section is empty.
Functions ¶
func SetKeepAlive ¶
SetKeepAlive sets the keepalive for the connection.
Types ¶
Click to show internal directories.
Click to hide internal directories.