Versions in this module Expand all Collapse all v1 v1.0.0 Dec 21, 2020 Changes in this version + const DEFAULT_DELAY + const DEFAULT_EPOLL_EVENTS + const DEFAULT_EPOLL_READ_TIMEOUT + const DEFAULT_EPOLL_WRITE_TIMEOUT + const DEFAULT_POOL_MULTIPLE + var ErrorBufferPool = errors.New("error getting buffer pool item") + func GetAddr(addr unix.Sockaddr) (string, int) + func GetAddrBytes(addr unix.Sockaddr) ([]byte, int) + type EP struct + Fd int + Host string + OnError OnErrorEvent + OnReceive OnReceiveEvent + Port int + QueueLength int + ReadBuffer int + ReuseAddr int + ReusePort int + Threads int + func New(readBuffer int, threads int, queueLength int) (*EP, error) + func (ep *EP) GetBufferPoolItem() (*[]byte, error) + func (ep *EP) InvokeError(code ErrorCode, err error) + func (ep *EP) InvokeReceive(from unix.Sockaddr, msg *[]byte, n int) + func (ep *EP) PutBufferPoolItem(buffer *[]byte) + func (ep *EP) SetDelay(t time.Duration) + func (ep *EP) SetReuseAddr(n int) + func (ep *EP) SetReusePort(n int) + func (ep *EP) Start(host string, port int) + func (ep *EP) Stop() + func (ep *EP) Write(to unix.Sockaddr, msg []byte) error + func (ep *EP) WriteWithTimeout(to unix.Sockaddr, msg []byte, timeout time.Duration) error + type ErrorCode int + const ERROR_BUFFER_POOL + const ERROR_RECEIVE + type OnErrorEvent func(code ErrorCode, err error) + type OnReceiveEvent func(from unix.Sockaddr, msg []byte, n int) + type OpCode int + const OP_ERROR + const OP_RECEIVE + type Request struct + Err error + ErrCode ErrorCode + From unix.Sockaddr + Id uint64 + Msg []byte + N int + Op OpCode