Documentation ¶
Index ¶
- Constants
- func GetId(name string) int
- func RmId(name string, id int)
- type Action
- type Listener
- type UDPMakeSession
- func (session *UDPMakeSession) Close() error
- func (session *UDPMakeSession) DoAction(action string, args ...interface{})
- func (session *UDPMakeSession) DoAction2(action string, args ...interface{})
- func (session *UDPMakeSession) DoWrite(s []byte) bool
- func (session *UDPMakeSession) LocalAddr() net.Addr
- func (session *UDPMakeSession) Read(p []byte) (n int, err error)
- func (session *UDPMakeSession) RemoteAddr() net.Addr
- func (session *UDPMakeSession) SetDeadline(t time.Time) error
- func (session *UDPMakeSession) SetReadDeadline(t time.Time) error
- func (session *UDPMakeSession) SetWriteDeadline(t time.Time) error
- func (session *UDPMakeSession) Write(b []byte) (n int, err error)
Constants ¶
View Source
const ( Reset byte = 0 FirstSYN byte = 6 FirstACK byte = 1 SndSYN byte = 2 SndACK byte = 2 Data byte = 4 Ping byte = 5 Close byte = 7 CloseBack byte = 8 ResetAck byte = 9 )
View Source
const ReadBufferSize = 7000 //so reader must be larger
View Source
const WriteBufferSize = 5000 //udp writer will add some data for checksum or encrypt
Variables ¶
This section is empty.
Functions ¶
Types ¶
type UDPMakeSession ¶
type UDPMakeSession struct {
// contains filtered or unexported fields
}
func Dial ¶
func Dial(addr string) (*UDPMakeSession, error)
func DialTimeout ¶
func DialTimeout(addr string, timeout int) (*UDPMakeSession, error)
func (*UDPMakeSession) Close ¶
func (session *UDPMakeSession) Close() error
func (*UDPMakeSession) DoAction ¶
func (session *UDPMakeSession) DoAction(action string, args ...interface{})
func (*UDPMakeSession) DoAction2 ¶
func (session *UDPMakeSession) DoAction2(action string, args ...interface{})
func (*UDPMakeSession) DoWrite ¶
func (session *UDPMakeSession) DoWrite(s []byte) bool
func (*UDPMakeSession) LocalAddr ¶
func (session *UDPMakeSession) LocalAddr() net.Addr
func (*UDPMakeSession) Read ¶
func (session *UDPMakeSession) Read(p []byte) (n int, err error)
udp read does not relay on the len(p), please make a big enough array to cache data
func (*UDPMakeSession) RemoteAddr ¶
func (session *UDPMakeSession) RemoteAddr() net.Addr
func (*UDPMakeSession) SetDeadline ¶
func (session *UDPMakeSession) SetDeadline(t time.Time) error
func (*UDPMakeSession) SetReadDeadline ¶
func (session *UDPMakeSession) SetReadDeadline(t time.Time) error
func (*UDPMakeSession) SetWriteDeadline ¶
func (session *UDPMakeSession) SetWriteDeadline(t time.Time) error
Directories ¶
Path | Synopsis |
---|---|
===================================================================== KCP - A Better ARQ Protocol Implementation skywind3000 (at) gmail.com, 2010-2011 Features: + Average RTT reduce 30% - 40% vs traditional ARQ like tcp.
|
===================================================================== KCP - A Better ARQ Protocol Implementation skywind3000 (at) gmail.com, 2010-2011 Features: + Average RTT reduce 30% - 40% vs traditional ARQ like tcp. |
Click to show internal directories.
Click to hide internal directories.