squic

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

QUIC/SCION implementation.

Index

Constants

View Source
const (
	// CtxTimedOutError is a custom QUIC error code that is used when canceling
	// writes due to context expiration.
	CtxTimedOutError quic.ErrorCode = iota + 1
	// OpenStreamError is the error code when failing to opening a stream.
	OpenStreamError
	// AcceptStreamError is the error code when failing to accept a stream.
	AcceptStreamError
)

Variables

This section is empty.

Functions

func Dial added in v0.5.0

func Dial(network *snet.SCIONNetwork, listen *net.UDPAddr, remote *snet.UDPAddr,
	svc addr.HostSVC, quicConfig *quic.Config) (quic.Session, error)

Dial dials using QUIC over the SCION network.

func Init

func Init(keyPath, pemPath string) error

func Listen added in v0.5.0

func Listen(network *snet.SCIONNetwork, listen *net.UDPAddr,
	svc addr.HostSVC, quicConfig *quic.Config) (quic.Listener, error)

Types

type ConnDialer added in v0.6.0

type ConnDialer struct {
	// Conn is the connection to initiate QUIC Sessions on. It can be shared
	// between clients and servers, because QUIC connection IDs are used to
	// demux the packets.
	Conn net.PacketConn
	// TLSConfig is the client's TLS configuration for starting QUIC connections.
	TLSConfig *tls.Config
	// QUICConfig is the client's QUIC configuration.
	QUICConfig *quic.Config
}

ConnDialer dials a net.Conn over a QUIC stream.

func (ConnDialer) Dial added in v0.6.0

func (d ConnDialer) Dial(ctx context.Context, dst net.Addr) (net.Conn, error)

Dial dials a QUIC stream and returns it as a net.Conn.

Note: This method dials with exponential backoff in case the dialing attempt fails due to a SERVER_BUSY error. Timers, number of attempts are EXPERIMENTAL and subject to change.

type ConnListener added in v0.6.0

type ConnListener struct {
	quic.Listener
	// contains filtered or unexported fields
}

ConnListener wraps a quic.Listener as a net.Listener.

func NewConnListener added in v0.6.0

func NewConnListener(l quic.Listener) *ConnListener

NewConnListener constructs a new listener with the appropriate buffers set.

func (*ConnListener) Accept added in v0.6.0

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

Accept accepts the first stream on a session and wraps it as a net.Conn.

XXX(roosd): Accept blocks until the first bytes on the stream are received. This will limit QPS heavily, but we should not yet be in a range where this matters too much.

func (*ConnListener) Close added in v0.6.0

func (l *ConnListener) Close() error

Close closes the listener.

Jump to

Keyboard shortcuts

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