Documentation ¶
Overview ¶
Package tcp implements the framework of TCP connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface { // DecodeFrom 从tcp连接中读取字节流数据进行解码,返回数据处理器Handler,数据处理器在单独goroutine中运行。 // 如果tcp连接接收缓冲没有数据,方法将会阻塞。 // 返回 error 保持与net包一致,io.EOF为对方关闭,net.ErrClosed为己方关闭 DecodeFrom(r io.Reader) (Handler, error) }
Decoder 是tcp连接的解码器
type HandlerFunc ¶
type HandlerFunc func() error
func (HandlerFunc) Handle ¶
func (f HandlerFunc) Handle() error
Click to show internal directories.
Click to hide internal directories.