Documentation ¶
Index ¶
- func DefaultSnmp() *kcp.Snmp
- func Dial(serverAddr string) (net.Conn, error)
- func DialWithOptions(serverAddr string, opt Option) (net.Conn, error)
- type Client
- func (c Client) Close() error
- func (c Client) LocalAddr() net.Addr
- func (c Client) Read(buf []byte) (n int, err error)
- func (c Client) RemoteAddr() net.Addr
- func (c Client) SetDeadline(t time.Time) error
- func (c Client) SetReadDeadline(t time.Time) error
- func (c Client) SetWriteDeadline(t time.Time) error
- func (c Client) Write(data []byte) (n int, err error)
- type KcpConn
- func (c *KcpConn) Close() error
- func (c *KcpConn) LocalAddr() net.Addr
- func (c *KcpConn) Read(buf []byte) (n int, err error)
- func (c *KcpConn) RemoteAddr() net.Addr
- func (c *KcpConn) SetDeadline(t time.Time) error
- func (c *KcpConn) SetReadDeadline(t time.Time) error
- func (c *KcpConn) SetWriteDeadline(t time.Time) error
- func (c *KcpConn) Write(data []byte) (n int, err error)
- type KcpListener
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSnmp ¶
func DefaultSnmp() *kcp.Snmp
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
kcp client type
func (Client) RemoteAddr ¶
type KcpConn ¶
type KcpConn struct {
// contains filtered or unexported fields
}
func (*KcpConn) RemoteAddr ¶
type KcpListener ¶
type KcpListener struct {
// contains filtered or unexported fields
}
kcp server type
func Listen ¶
func Listen(listenAddr string) (*KcpListener, error)
func ListenWithOptions ¶
func ListenWithOptions(listenAddr string, opt Option) (*KcpListener, error)
func (*KcpListener) Addr ¶
func (s *KcpListener) Addr() net.Addr
func (*KcpListener) Close ¶
func (s *KcpListener) Close() error
type Option ¶
type Option struct { Key string `json:"key"` /* Must be the same between c-s */ Crypt string `json:"crypt"` /* Must be the same between c-s */ DataShard int `json:"datashard"` /* Must be the same between c-s */ ParityShard int `json:"parityshard"` /* Must be the same between c-s */ NoComp bool `json:"nocomp"` /* Must be the same between c-s */ MTU int `json:"mtu"` SndWnd int `json:"sndwnd"` RcvWnd int `json:"rcvwnd"` DSCP int `json:"dscp"` AckNodelay bool `json:"acknodelay"` SockBuf int `json:"sockbuf"` // Shared with smux session // mode params Mode string `json:"mode"` NoDelay int `json:"nodelay"` Interval int `json:"interval"` Resend int `json:"resend"` NoCongestion int `json:"nc"` }
kcp options
Click to show internal directories.
Click to hide internal directories.