Documentation ¶
Index ¶
- Variables
- func ClientTLSConfig() *tls.Config
- func ConnReceiveMessage(conn net.Conn, data interface{}) error
- func ConnSendMessage(conn net.Conn, data interface{}) error
- func RUDPReceiveAllMessage(conn *reliableUDP.ReliableUDP, timeout time.Duration, msg interface{}) (*net.UDPAddr, error)
- func RUDPSendMessage(conn *reliableUDP.ReliableUDP, addr string, msg interface{}, ...) error
- func RUDPSendUnreliableMessage(conn *reliableUDP.ReliableUDP, addr string, msg interface{}) error
- func ServerTLSConfig() *tls.Config
- func TCPRandListen() (*net.TCPListener, error)
- func UDPRandListen() (*net.UDPConn, error)
- func UdpReceiveMessage(conn *net.UDPConn, data interface{}) (*net.UDPAddr, error)
- func UdpSendByteMessage(conn *net.UDPConn, target *net.UDPAddr, data []byte) error
- func UdpSendMessage(conn *net.UDPConn, target *net.UDPAddr, data interface{}) error
- type ReliableUDPServer
- type ReliableUDPStreamHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStreamHandlerNotSet = errors.InternalServer("stream handler not set", "stream handler not set")
)
Functions ¶
func ClientTLSConfig ¶
func ConnReceiveMessage ¶
func ConnSendMessage ¶
func RUDPReceiveAllMessage ¶
func RUDPReceiveAllMessage(conn *reliableUDP.ReliableUDP, timeout time.Duration, msg interface{}) (*net.UDPAddr, error)
func RUDPSendMessage ¶
func RUDPSendMessage(conn *reliableUDP.ReliableUDP, addr string, msg interface{}, timeout time.Duration) error
发送超时时间为timeout,如果timeout为0则默认为4秒
func RUDPSendUnreliableMessage ¶
func RUDPSendUnreliableMessage(conn *reliableUDP.ReliableUDP, addr string, msg interface{}) error
func ServerTLSConfig ¶
func TCPRandListen ¶
func TCPRandListen() (*net.TCPListener, error)
func UDPRandListen ¶
func UdpReceiveMessage ¶
func UdpSendByteMessage ¶
Types ¶
type ReliableUDPServer ¶
func NewReliableUDPServer ¶
func NewReliableUDPServer(udpConn *net.UDPConn) (*ReliableUDPServer, error)
func (*ReliableUDPServer) SetStreamHandler ¶
func (s *ReliableUDPServer) SetStreamHandler(handler ReliableUDPStreamHandler)
SetStreamHandler sets the stream handler
type ReliableUDPStreamHandler ¶
type ReliableUDPStreamHandler = func(conn quic.Connection, stream quic.Stream) error
Click to show internal directories.
Click to hide internal directories.