mux

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMplexPeer

func NewMplexPeer(config multiplexer.Config) (multiplexer.Peer, error)

func NewQuicPeer

func NewQuicPeer(config multiplexer.Config) (multiplexer.Peer, error)

func NewYamuxPeer

func NewYamuxPeer(config multiplexer.Config) (multiplexer.Peer, error)

func QUICConfig

func QUICConfig() *quic.Config

func WrapQUIC

func WrapQUIC(session quic.Session, stream quic.Stream) net.Conn

Types

type Mplex

type Mplex struct {
	// contains filtered or unexported fields
}

Mplex is a Peer implementation using libp2p's mplex

func (*Mplex) Addr

func (p *Mplex) Addr() net.Addr

func (*Mplex) Bidirectional

func (p *Mplex) Bidirectional(ctx context.Context, conn net.Conn, link multiplexer.Link) (<-chan error, error)

func (*Mplex) Bye

func (p *Mplex) Bye() error

func (*Mplex) Direct

func (p *Mplex) Direct(ctx context.Context, link multiplexer.Link) (net.Conn, error)

func (*Mplex) Handle

func (p *Mplex) Handle() <-chan multiplexer.LinkConnection

func (*Mplex) Initiator

func (p *Mplex) Initiator() bool

func (*Mplex) Messaging

func (p *Mplex) Messaging(ctx context.Context) (net.Conn, error)

func (*Mplex) NotifyClose

func (p *Mplex) NotifyClose() <-chan struct{}

func (*Mplex) Null

func (p *Mplex) Null(ctx context.Context)

func (*Mplex) Peer

func (p *Mplex) Peer() uint64

func (*Mplex) Protocol

func (p *Mplex) Protocol() protocol.Protocol

func (*Mplex) Start

func (p *Mplex) Start(ctx context.Context)

type QUIC

type QUIC struct {
	// contains filtered or unexported fields
}

func (*QUIC) Addr

func (p *QUIC) Addr() net.Addr

func (*QUIC) Bidirectional

func (p *QUIC) Bidirectional(ctx context.Context, conn net.Conn, link multiplexer.Link) (<-chan error, error)

func (*QUIC) Bye

func (p *QUIC) Bye() error

func (*QUIC) Direct

func (p *QUIC) Direct(ctx context.Context, link multiplexer.Link) (net.Conn, error)

func (*QUIC) Handle

func (p *QUIC) Handle() <-chan multiplexer.LinkConnection

func (*QUIC) Initiator

func (p *QUIC) Initiator() bool

func (*QUIC) Messaging

func (p *QUIC) Messaging(ctx context.Context) (net.Conn, error)

func (*QUIC) NotifyClose

func (p *QUIC) NotifyClose() <-chan struct{}

func (*QUIC) Null

func (p *QUIC) Null(ctx context.Context)

func (*QUIC) Peer

func (p *QUIC) Peer() uint64

func (*QUIC) Protocol

func (p *QUIC) Protocol() protocol.Protocol

func (*QUIC) Start

func (p *QUIC) Start(ctx context.Context)

type Yamux

type Yamux struct {
	// contains filtered or unexported fields
}

Yamux is a Peer implementation using hashicorp's Yamux

func (*Yamux) Addr

func (p *Yamux) Addr() net.Addr

func (*Yamux) Bidirectional

func (p *Yamux) Bidirectional(ctx context.Context, conn net.Conn, link multiplexer.Link) (<-chan error, error)

func (*Yamux) Bye

func (p *Yamux) Bye() error

func (*Yamux) Direct

func (p *Yamux) Direct(ctx context.Context, link multiplexer.Link) (net.Conn, error)

func (*Yamux) Handle

func (p *Yamux) Handle() <-chan multiplexer.LinkConnection

func (*Yamux) Initiator

func (p *Yamux) Initiator() bool

func (*Yamux) Messaging

func (p *Yamux) Messaging(ctx context.Context) (net.Conn, error)

func (*Yamux) NotifyClose

func (p *Yamux) NotifyClose() <-chan struct{}

func (*Yamux) Null

func (p *Yamux) Null(ctx context.Context)

Null will terminate the session as soon a new stream request is received. This is primarily used to disconnect badly behaving clients.

func (*Yamux) Peer

func (p *Yamux) Peer() uint64

func (*Yamux) Protocol

func (p *Yamux) Protocol() protocol.Protocol

func (*Yamux) Start

func (p *Yamux) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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