Documentation ¶
Index ¶
- Constants
- Variables
- func NewListener(conn *net.UDPConn, tlsConfig *tls.Config, quicConfig *quic.Config) (net.Listener, error)
- func TrackClose(conn rpc.ConnectorConn) rpc.ConnectorConn
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ConnectionState() tls.ConnectionState
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (n int, err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (_ int, err error)
- type Connector
- type Listener
Constants ¶
const IsSupported = true
IsSupported returns whether quic building is enabled.
Variables ¶
var ( // Error is a pkg/quic error. Error = errs.Class("quic") // ErrQuicDisabled indicates QUIC has been disabled at build time. ErrQuicDisabled = Error.New("disabled at build time") )
Functions ¶
func NewListener ¶
func NewListener(conn *net.UDPConn, tlsConfig *tls.Config, quicConfig *quic.Config) (net.Listener, error)
NewListener returns a new listener instance for QUIC. The quic.Config may be nil, in that case the default values will be used. if the provided context is closed, all existing or following Accept calls will return an error.
func TrackClose ¶
func TrackClose(conn rpc.ConnectorConn) rpc.ConnectorConn
TrackClose wraps the conn and sets a finalizer on the returned value to close the conn and monitor that it was leaked.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a wrapper around a quic connection and fulfills net.Conn interface.
func (*Conn) ConnectionState ¶
func (c *Conn) ConnectionState() tls.ConnectionState
ConnectionState converts quic session state to tls connection state and returns tls state.
func (*Conn) RemoteAddr ¶
RemoteAddr returns the address of the peer.
func (*Conn) SetDeadline ¶
SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
func (*Conn) SetReadDeadline ¶
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector implements a dialer that creates a quic connection.
func NewDefaultConnector ¶
func NewDefaultConnector(quicConfig *quic.Config) Connector
NewDefaultConnector instantiates a new instance of Connector. If no quic configuration is provided, default value will be used.
func (Connector) DialContext ¶
func (c Connector) DialContext(ctx context.Context, tlsConfig *tls.Config, address string) (_ rpc.ConnectorConn, err error)
DialContext creates a quic connection.
func (*Connector) SetTransferRate ¶
SetTransferRate sets the transfer rate to the given value.
func (Connector) TransferRate ¶
TransferRate returns the transfer rate set on the connector.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener implements listener for QUIC.
func (*Listener) Accept ¶
Accept waits for and returns the next available quic session to the listener.