Documentation
¶
Index ¶
- Constants
- Variables
- func GetAddr(addr unix.Sockaddr) (string, int)
- func GetAddrBytes(addr unix.Sockaddr) ([]byte, int)
- type EP
- 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
- type OnErrorEvent
- type OnReceiveEvent
- type OpCode
- type Request
Constants ¶
View Source
const ( DEFAULT_EPOLL_EVENTS = 4096 DEFAULT_EPOLL_READ_TIMEOUT = 5 DEFAULT_EPOLL_WRITE_TIMEOUT = 5 DEFAULT_POOL_MULTIPLE = 5 DEFAULT_DELAY = 200 )
Variables ¶
View Source
var (
ErrorBufferPool = errors.New("error getting buffer pool item")
)
Functions ¶
Types ¶
type EP ¶
type EP struct { Host string Port int Fd int Threads int QueueLength int ReadBuffer int ReuseAddr int ReusePort int OnReceive OnReceiveEvent OnError OnErrorEvent // contains filtered or unexported fields }
func (*EP) GetBufferPoolItem ¶
func (*EP) InvokeError ¶
func (*EP) PutBufferPoolItem ¶
func (*EP) SetReuseAddr ¶
func (*EP) SetReusePort ¶
type OnErrorEvent ¶
Click to show internal directories.
Click to hide internal directories.