Documentation ¶
Index ¶
- func DialAddrContext(network string, laddr *net.UDPAddr, raddr string, tlsConf *tls.Config, ...) (net.Conn, error)
- func InheritedListen(network, laddr string, tlsConf *tls.Config, dataShards, parityShards int) (net.Listener, error)
- func SetInherited() error
- type Listener
- func Listen(conn net.PacketConn, tlsConf *tls.Config, dataShards, parityShards int) (*Listener, error)
- func ListenAddr(network, addr string, tlsConf *tls.Config, dataShards, parityShards int) (*Listener, error)
- func ListenUDPAddr(network string, udpAddr *net.UDPAddr, tlsConf *tls.Config, ...) (*Listener, error)
- type UDPSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialAddrContext ¶
func DialAddrContext(network string, laddr *net.UDPAddr, raddr string, tlsConf *tls.Config, dataShards, parityShards int) (net.Conn, error)
DialAddrContext establishes a new KCP connection to a server. It uses a new UDP connection and closes this connection when the KCP session is closed. The hostname for SNI is taken from the given address.
func InheritedListen ¶
func InheritedListen(network, laddr string, tlsConf *tls.Config, dataShards, parityShards int) (net.Listener, error)
InheritedListen announces on the local network address laddr. The network net is "KCP". It returns an inherited net.Listener for the matching network and address, or creates a new one using net.Listen.
func SetInherited ¶
func SetInherited() error
SetInherited adds the files and envs to be inherited by the new process. Notes:
Only for reboot! Windows system are not supported!
Types ¶
type Listener ¶
Listener defines a server which will be waiting to accept incoming connections
func Listen ¶
func Listen(conn net.PacketConn, tlsConf *tls.Config, dataShards, parityShards int) (*Listener, error)
Listen listens for KCP connections on a given net.PacketConn.
func ListenAddr ¶
func ListenAddr(network, addr string, tlsConf *tls.Config, dataShards, parityShards int) (*Listener, error)
ListenAddr announces on the local network address addr.
func ListenUDPAddr ¶
func ListenUDPAddr(network string, udpAddr *net.UDPAddr, tlsConf *tls.Config, dataShards, parityShards int) (*Listener, error)
ListenUDPAddr announces on the local network address udpAddr.
func (*Listener) Accept ¶
Accept implements the Accept method in the Listener interface; it waits for the next call and returns a generic Conn.
func (*Listener) PacketConn ¶
func (l *Listener) PacketConn() net.PacketConn
PacketConn returns the net.PacketConn.
type UDPSession ¶
type UDPSession = kcp.UDPSession
UDPSession defines a KCP session implemented by UDP