go-libp2p-transport-upgrader: github.com/libp2p/go-libp2p-transport-upgrader Index | Files

package stream

import "github.com/libp2p/go-libp2p-transport-upgrader"


Package Files

conn.go listener.go threshold.go upgrader.go


var AcceptQueueLength = 16

AcceptQueueLength is the number of connections to fully setup before not accepting any new connections

var ErrNilPeer = errors.New("nil peer")

ErrNilPeer is returned when attempting to upgrade an outbound connection without specifying a peer ID.

type Upgrader Uses

type Upgrader struct {
    PSK       ipnet.PSK
    Secure    sec.SecureTransport
    Muxer     mux.Multiplexer
    ConnGater connmgr.ConnectionGater

Upgrader is a multistream upgrader that can upgrade an underlying connection to a full transport connection (secure and multiplexed).

func (*Upgrader) UpgradeInbound Uses

func (u *Upgrader) UpgradeInbound(ctx context.Context, t transport.Transport, maconn manet.Conn) (transport.CapableConn, error)

UpgradeInbound upgrades the given inbound multiaddr-net connection into a full libp2p-transport connection.

func (*Upgrader) UpgradeListener Uses

func (u *Upgrader) UpgradeListener(t transport.Transport, list manet.Listener) transport.Listener

UpgradeListener upgrades the passed multiaddr-net listener into a full libp2p-transport listener.

func (*Upgrader) UpgradeOutbound Uses

func (u *Upgrader) UpgradeOutbound(ctx context.Context, t transport.Transport, maconn manet.Conn, p peer.ID) (transport.CapableConn, error)

UpgradeOutbound upgrades the given outbound multiaddr-net connection into a full libp2p-transport connection.

Package stream imports 16 packages (graph) and is imported by 27 packages. Updated 2021-01-25. Refresh now. Tools for package owners.