IrohBeam. Connection
(iroh_beam v0.2.0)
View Source
Mutually authenticated Iroh connection.
Connections negotiate one explicit application ALPN and expose the remote key-derived endpoint identity. They are application transports, not Erlang distribution links.
Summary
Types
@type t() :: %IrohBeam.Connection{ alpn: String.t(), owner: pid(), remote_id: IrohBeam.EndpointId.t(), resource: reference(), role: :outgoing | :incoming, side: :client | :server, stable_id: non_neg_integer() }
Functions
@spec accept_bi( t(), keyword() ) :: {:ok, IrohBeam.Stream.t()} | {:error, IrohBeam.Error.t()}
@spec accept_uni( t(), keyword() ) :: {:ok, IrohBeam.Stream.t()} | {:error, IrohBeam.Error.t()}
@spec close(t()) :: :ok
@spec close_reason(t()) :: nil | IrohBeam.Error.t()
@spec closed(t(), timeout()) :: :ok | {:error, IrohBeam.Error.t()}
@spec datagram_info(t()) :: {:ok, map()} | {:error, IrohBeam.Error.t()}
@spec info(t()) :: {:ok, map()} | {:error, IrohBeam.Error.t()}
@spec open_bi( t(), keyword() ) :: {:ok, IrohBeam.Stream.t()} | {:error, IrohBeam.Error.t()}
@spec open_uni( t(), keyword() ) :: {:ok, IrohBeam.Stream.t()} | {:error, IrohBeam.Error.t()}
@spec path(t()) :: {:ok, map() | nil} | {:error, IrohBeam.Error.t()}
@spec recv_datagram( t(), keyword() ) :: {:ok, binary()} | {:error, IrohBeam.Error.t()}
@spec remote_id(t()) :: IrohBeam.EndpointId.t()
@spec role(t()) :: :outgoing | :incoming
@spec send_datagram(t(), binary(), keyword()) :: :ok | {:error, IrohBeam.Error.t()}
@spec side(t()) :: :client | :server
@spec stable_id(t()) :: non_neg_integer()