Versions in this module Expand all Collapse all v1 v1.17.5 May 22, 2022 Changes in this version + var DefaultMaxHeaderBytes int = 1 << 20 + func NewMemAreaPool() *memAreaPool + type Agent interface + OnClose func() + Run func() + type CAFile struct + CertFile string + Keyfile string + type Conn interface + Close func() + Destroy func() + LocalAddr func() net.Addr + ReadMsg func() ([]byte, error) + ReleaseReadMsg func(byteBuff []byte) + RemoteAddr func() net.Addr + WriteMsg func(args ...[]byte) error + type ConnSet map[net.Conn]struct + type HttpServer struct + func (slf *HttpServer) Init(listenAddr string, handler http.Handler, readTimeout time.Duration, ...) + func (slf *HttpServer) SetCAFile(caFile []CAFile) + func (slf *HttpServer) Start() + type INetMempool interface + MakeByteSlice func(size int) []byte + ReleaseByteSlice func(byteBuff []byte) bool + type MsgParser struct + func NewMsgParser() *MsgParser + func (p *MsgParser) Read(conn *TCPConn) ([]byte, error) + func (p *MsgParser) SetByteOrder(littleEndian bool) + func (p *MsgParser) SetMsgLen(lenMsgLen int, minMsgLen uint32, maxMsgLen uint32) + func (p *MsgParser) Write(conn *TCPConn, args ...[]byte) error + type TCPClient struct + Addr string + AutoReconnect bool + ConnNum int + ConnectInterval time.Duration + LenMsgLen int + LittleEndian bool + MaxMsgLen uint32 + MinMsgLen uint32 + NewAgent func(*TCPConn) Agent + PendingWriteNum int + func (client *TCPClient) Close(waitDone bool) + func (client *TCPClient) Start() + type TCPConn struct + func (tcpConn *TCPConn) Close() + func (tcpConn *TCPConn) Destroy() + func (tcpConn *TCPConn) GetRemoteIp() string + func (tcpConn *TCPConn) IsConnected() bool + func (tcpConn *TCPConn) LocalAddr() net.Addr + func (tcpConn *TCPConn) Read(b []byte) (int, error) + func (tcpConn *TCPConn) ReadMsg() ([]byte, error) + func (tcpConn *TCPConn) ReleaseReadMsg(byteBuff []byte) + func (tcpConn *TCPConn) RemoteAddr() net.Addr + func (tcpConn *TCPConn) SetReadDeadline(d time.Duration) + func (tcpConn *TCPConn) SetWriteDeadline(d time.Duration) + func (tcpConn *TCPConn) Write(b []byte) error + func (tcpConn *TCPConn) WriteMsg(args ...[]byte) error + func (tcpConn *TCPConn) WriteRawMsg(args []byte) error + type TCPServer struct + Addr string + LenMsgLen int + LittleEndian bool + MaxConnNum int + MaxMsgLen uint32 + MinMsgLen uint32 + NewAgent func(*TCPConn) Agent + PendingWriteNum int + func (server *TCPServer) Close() + func (server *TCPServer) GetNetMempool() INetMempool + func (server *TCPServer) SetNetMempool(mempool INetMempool) + func (server *TCPServer) Start() + type WSClient struct + Addr string + AutoReconnect bool + ConnNum int + ConnectInterval time.Duration + HandshakeTimeout time.Duration + MaxMsgLen uint32 + NewAgent func(*WSConn) Agent + PendingWriteNum int + func (client *WSClient) Close() + func (client *WSClient) Start() + type WSConn struct + func (wsConn *WSConn) Close() + func (wsConn *WSConn) Destroy() + func (wsConn *WSConn) LocalAddr() net.Addr + func (wsConn *WSConn) ReadMsg() ([]byte, error) + func (wsConn *WSConn) RemoteAddr() net.Addr + func (wsConn *WSConn) WriteMsg(args ...[]byte) error + type WSHandler struct + func (handler *WSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type WSServer struct + Addr string + CertFile string + HTTPTimeout time.Duration + KeyFile string + MaxConnNum int + MaxMsgLen uint32 + NewAgent func(*WSConn) Agent + PendingWriteNum int + func (server *WSServer) Close() + func (server *WSServer) Start() + type WebsocketConnSet map[*websocket.Conn]struct