Documentation
¶
Overview ¶
tcpsock document
Package tcpsock provides easy to use interfaces for TCP I/O. Thanks to darksword(gansidui) and AlexStocks for their valuable projects which are gotcp(https://github.com/gansidui/gotcp) and getty(https://github.com/AlexStocks/getty).
Index ¶
Constants ¶
View Source
const ( RecvBufLenMax = 4 * 1024 SendBufLenMax = 4 * 1024 SendBufCapMax = 10 RecvBufCapMax = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnTcpConnCallback ¶
type OnTcpConnCallback func(c *TcpConn)
type OnTcpCustomProtocol ¶
type OnTcpCustomProtocol func() Protocol
type TcpClient ¶
type TcpClient struct {
// contains filtered or unexported fields
}
func NewTcpClient ¶
func NewTcpClient(svrAddr string, onConnConnect, onConnClose OnTcpConnCallback, onCustomProtocol OnTcpCustomProtocol) *TcpClient
type TcpServer ¶
type TcpServer struct {
// contains filtered or unexported fields
}
func NewTcpServer ¶
func NewTcpServer(listenPort, acceptTimeout int, onConnConnect, onConnClose OnTcpConnCallback, onCustomProtocol OnTcpCustomProtocol) *TcpServer
Directories
¶
Path | Synopsis |
---|---|
samples
|
|