Documentation ¶
Index ¶
- Constants
- func GatherCandidates(sock *net.UDPConn, outIpList string, udpAddr string) ([]candidate, error)
- type AttemptEngine
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Ping() (int, error)
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) Run()
- func (c *Conn) SetCrypt(encode, decode func([]byte) []byte)
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetFec(DataShards, ParityShards int) (er error)
- func (c *Conn) SetKcp(setting *KcpSetting)
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type KcpSetting
Constants ¶
View Source
const ( Ping byte = 1 Data byte = 2 FecData byte = 1 FecOver byte = 2 )
View Source
const CacheBuffSize = SendBuffSize * 1.5
View Source
const SendBuffSize = 2000 //after kcp_send , 3k+, after compress, 3k+ * 1.5+ ,,this size is limited by bufio.Scanner
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AttemptEngine ¶
type AttemptEngine struct { Kcp *KcpSetting D, P int // contains filtered or unexported fields }
func (*AttemptEngine) Fail ¶
func (e *AttemptEngine) Fail()
func (*AttemptEngine) GetAddrList ¶
func (e *AttemptEngine) GetAddrList() string
func (*AttemptEngine) SetOtherAddrList ¶
func (e *AttemptEngine) SetOtherAddrList(addrList string)
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶
func (*Conn) SetKcp ¶
func (c *Conn) SetKcp(setting *KcpSetting)
type KcpSetting ¶
type KcpSetting struct { Nodelay int32 Interval int32 //not for set Resend int32 Nc int32 Sndwnd int32 Rcvwnd int32 Mtu int32 }
func DefaultKcpSetting ¶
func DefaultKcpSetting() *KcpSetting
Click to show internal directories.
Click to hide internal directories.