Libp2p.StreamNegotiator (libp2p_elixir v0.9.0)

Multistream-select negotiation on top of an established yamux stream.

Uses Libp2p.Connection.stream_send/3 and stream_recv/3 as the transport.

Summary

Types

proto_id()

@type proto_id() :: binary()

Functions

negotiate_inbound(conn, stream_id, supported, opts \\ [])

@spec negotiate_inbound(pid(), non_neg_integer(), MapSet.t(proto_id()), keyword()) ::
  {:ok, proto_id(), binary()} | {:error, term()}

negotiate_outbound(conn, stream_id, proposals, supported, opts \\ [])

@spec negotiate_outbound(
  pid(),
  non_neg_integer(),
  [proto_id()],
  MapSet.t(proto_id()),
  keyword()
) ::
  {:ok, proto_id(), binary()} | {:error, term()}