Libp2p.ConnUpgrade (libp2p_elixir v0.9.0)

Connection upgrade pipeline: multistream-select → noise → multistream-select → yamux.

This module performs the on-wire negotiation and returns a Libp2p.SecureConn.

Summary

Types

role()

@type role() :: :initiator | :responder

socket()

@type socket() :: Libp2p.Transport.Tcp.socket()

Functions

upgrade_inbound(sock, id, opts \\ [])

@spec upgrade_inbound(socket(), Libp2p.Identity.t(), keyword()) ::
  {:ok, Libp2p.SecureConn.t(), Libp2p.Yamux.Session.t(), binary()}
  | {:error, term()}

upgrade_outbound(sock, id, opts \\ [])

@spec upgrade_outbound(socket(), Libp2p.Identity.t(), keyword()) ::
  {:ok, Libp2p.SecureConn.t(), Libp2p.Yamux.Session.t(), binary()}
  | {:error, term()}