Documentation
¶
Index ¶
- Constants
- Variables
- func GetLogger() logger
- func SetLogger(l logger)
- func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- type Conn
- func (c *Conn) Close()
- func (c *Conn) CloseRead() error
- func (c *Conn) GetAddr() string
- func (c *Conn) GetBuffer() *codec.Buffer
- func (c *Conn) GetData() interface{}
- func (c *Conn) GetFd() int32
- func (c *Conn) SetData(data interface{})
- func (c *Conn) Write(bytes []byte) (int, error)
- func (c *Conn) WriteWithEncoder(bytes []byte) error
- type Handler
- type Option
- type Server
Constants ¶
View Source
const ( EpollRead = syscall.EPOLLIN | syscall.EPOLLPRI | syscall.EPOLLERR | syscall.EPOLLHUP | unix.EPOLLET | syscall.EPOLLRDHUP EpollClose = uint32(syscall.EPOLLIN | syscall.EPOLLRDHUP) )
对端关闭连接 8193
View Source
const ( EventIn = 1 // 数据流入 EventClose = 2 // 断开连接 EventTimeout = 3 // 检测到超时 )
Variables ¶
View Source
var (
ErrReadTimeout = errors.New("tcp read timeout")
)
Functions ¶
func TimeEncoder ¶
func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn 客户端长连接
func (*Conn) WriteWithEncoder ¶
WriteWithEncoder 使用编码器写入
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithIOEventQueueLen ¶
WithIOEventQueueLen 设置IO事件队列长度,默认值是1024
Source Files
¶
Click to show internal directories.
Click to hide internal directories.