Versions in this module Expand all Collapse all v1 v1.0.3 Nov 20, 2024 v1.0.2 Nov 20, 2024 v1.0.1 Nov 19, 2024 Changes in this version + const DefaultCongestionControl + const DefaultDSCP + const DefaultDataShards + const DefaultIntervalMill + const DefaultMaxConnNum + const DefaultMtu + const DefaultNoDelay + const DefaultParityShards + const DefaultRcvWndSize + const DefaultReadDeadlineMill + const DefaultResend + const DefaultSndWndSize + const DefaultStreamMode + const DefaultWriteDeadlineMill + const Default_LenMsgLen + const Default_MaxConnNum + const Default_MaxMsgLen + const Default_MinMsgLen + const Default_PendingWriteNum + const Default_ReadDeadline + const Default_WriteDeadline + var DefaultMaxHeaderBytes = 1 << 20 + 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 KCPClient struct + Addr string + AutoReconnect bool + ConnNum int + ConnectInterval time.Duration + NewAgent func(conn *NetConn) Agent + PendingWriteNum int + ReadDeadline time.Duration + WriteDeadline time.Duration + func (client *KCPClient) Close(waitDone bool) + func (client *KCPClient) GetCloseFlag() bool + func (client *KCPClient) Start() + type KCPServer struct + NewAgent func(Conn) Agent + func (kp *KCPServer) Close() + func (kp *KCPServer) Init(kcpCfg *KcpCfg) + func (kp *KCPServer) Start() error + type KcpCfg struct + DSCP *int + DataShards *int + LenMsgLen int + ListenAddr string + LittleEndian bool + MaxConnNum int + MaxMsgLen uint32 + MinMsgLen uint32 + Mtu *int + NoDelay *NoDelayCfg + ParityShards *int + PendingWriteNum int + RcvWndSize *int + ReadBuffSize *int + ReadDeadlineMill *time.Duration + SndWndSize *int + StreamMode *bool + WriteBuffSize *int + WriteDeadlineMill *time.Duration + type MsgParser struct + LenMsgLen int + LittleEndian bool + MaxMsgLen uint32 + MinMsgLen uint32 + func (p *MsgParser) GetRecyclerReaderBytes() func(data []byte) + func (p *MsgParser) Init() + func (p *MsgParser) Read(r io.Reader) ([]byte, error) + func (p *MsgParser) Write(conn io.Writer, args ...[]byte) error + type NetConn struct + func (netConn *NetConn) Close() + func (netConn *NetConn) Destroy() + func (netConn *NetConn) GetRecyclerReaderBytes() func(data []byte) + func (netConn *NetConn) GetRemoteIp() string + func (netConn *NetConn) IsConnected() bool + func (netConn *NetConn) LocalAddr() net.Addr + func (netConn *NetConn) Read(b []byte) (int, error) + func (netConn *NetConn) ReadMsg() ([]byte, error) + func (netConn *NetConn) ReleaseReadMsg(byteBuff []byte) + func (netConn *NetConn) RemoteAddr() net.Addr + func (netConn *NetConn) SetReadDeadline(d time.Duration) + func (netConn *NetConn) SetWriteDeadline(d time.Duration) + func (netConn *NetConn) Write(b []byte) error + func (netConn *NetConn) WriteMsg(args ...[]byte) error + func (netConn *NetConn) WriteRawMsg(args []byte) error + type NoDelayCfg struct + CongestionControl int + IntervalMill int + NoDelay int + Resend int + type TCPClient struct + Addr string + AutoReconnect bool + ConnNum int + ConnectInterval time.Duration + NewAgent func(conn *NetConn) Agent + PendingWriteNum int + ReadDeadline time.Duration + WriteDeadline time.Duration + func (client *TCPClient) Close(waitDone bool) + func (client *TCPClient) GetCloseFlag() bool + func (client *TCPClient) Start() + type TCPServer struct + Addr string + MaxConnNum int + NewAgent func(conn Conn) Agent + PendingWriteNum int + ReadDeadline time.Duration + WriteDeadline time.Duration + func (server *TCPServer) Close() + func (server *TCPServer) GetNetMemPool() bytespool.IBytesMemPool + func (server *TCPServer) SetNetMemPool(memPool bytespool.IBytesMemPool) + func (server *TCPServer) Start() error + type WSClient struct + Addr string + AutoReconnect bool + ConnNum int + ConnectInterval time.Duration + HandshakeTimeout time.Duration + MaxMsgLen uint32 + MessageType int + 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) GetHeader() http.Header + 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) + func (handler *WSHandler) SetMessageType(messageType int) + 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) SetMessageType(messageType int) + func (server *WSServer) Start() error + type WebsocketConnSet map[*websocket.Conn]struct