Documentation ¶
Overview ¶
Package yquic provides a quic implementation of yomo.FrameConn.
Index ¶
Constants ¶
const YomoCloseErrorCode = quic.ApplicationErrorCode(0x13)
YomoCloseErrorCode is the error code for close quic Connection for yomo. If the Connection implemented by quic is closed, the quic ApplicationErrorCode is always 0x13.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrameConn ¶
type FrameConn struct {
// contains filtered or unexported fields
}
FrameConn is an implements of FrameConn, It transmits frames upon the first stream from a QUIC connection.
func DialAddr ¶
func DialAddr( ctx context.Context, addr string, codec frame.Codec, prw frame.PacketReadWriter, tlsConfig *tls.Config, quicConfig *quic.Config, ) (*FrameConn, error)
DialAddr dials the given address and returns a new FrameConn.
func (*FrameConn) CloseWithError ¶
CloseWithError closes the connection. After calling CloseWithError, ReadFrame and WriteFrame will return frame.ErrConnClosed error.
func (*FrameConn) RemoteAddr ¶
RemoteAddr returns the remote address of connection.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener listens a net.PacketConn and accepts connections.
func Listen ¶
func Listen( conn net.PacketConn, codec frame.Codec, prw frame.PacketReadWriter, tlsConfig *tls.Config, quicConfig *quic.Config, ) (*Listener, error)
Listen returns a quic Listener that can accept connections.
func ListenAddr ¶
func ListenAddr( addr string, codec frame.Codec, prw frame.PacketReadWriter, tlsConfig *tls.Config, quicConfig *quic.Config, ) (*Listener, error)
ListenAddr listens an address and returns a new Listener.