transport

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialOnConn

func DialOnConn(ctx context.Context, udp net.PacketConn, addr net.Addr) (net.Conn, error)

DialOnConn opens a QUIC connection to addr over an already-bound UDP socket. Not migratable on purpose: migration binds a fresh socket, which the relay sees as unpaired and drops.

func ListenOnConn

func ListenOnConn(udp net.PacketConn) (net.Listener, error)

ListenOnConn serves QUIC on an already-bound UDP socket. The relay pairs by source address, so the registered socket must be the one QUIC listens on. Closing the listener closes it.

Types

type MigratableConn

type MigratableConn struct {
	net.Conn // the one-stream adapter (quicConn)
	// contains filtered or unexported fields
}

MigratableConn is a QUIC-backed net.Conn dialed on an explicit quic.Transport, so the connection can migrate to a fresh local UDP socket (Wi-Fi -> LTE) while the stream and everything layered on it (SecureConn, gRPC) survive untouched. The plain Transport.Dial uses quic.DialAddr, whose connection cannot AddPath.

func DialQUICMigratable

func DialQUICMigratable(ctx context.Context, addr string) (*MigratableConn, error)

DialQUICMigratable dials addr over QUIC on an explicit transport and returns the stream as a migratable net.Conn.

func (*MigratableConn) Close

func (m *MigratableConn) Close() error

Close tears down the stream, the connection, and every transport it ever used.

func (*MigratableConn) Migrate

func (m *MigratableConn) Migrate(ctx context.Context) (oldAddr, newAddr net.Addr, err error)

Migrate moves the connection to a fresh local UDP socket and returns the old and new local addresses. The caller must send traffic right after (e.g. a ping) so the peer migrates its send path too.

type Transport

type Transport interface {
	// Dial connects to addr and returns a net.Conn ready to carry gRPC.
	Dial(ctx context.Context, addr string) (net.Conn, error)
	// Listen returns a net.Listener yielding gRPC-ready conns.
	Listen(addr string) (net.Listener, error)
}

Transport establishes gRPC-ready net.Conns over a wire protocol. Two implementations: TCP (the fast bulk data plane) and QUIC (migration-capable: the always-on control channel and the degraded-link fallback). One interface covers both uniformly.

func QUIC

func QUIC() Transport

QUIC returns a QUIC transport (one bidirectional stream per connection = one net.Conn, mirroring KeibiDrop's per-direction socket).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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