kcp

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

type Listener struct {
	*kcp.Listener
	// contains filtered or unexported fields
}

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

func (l *Listener) Accept() (net.Conn, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL