Caracola.Transport.Port (Caracola v0.1.0-rc.1)

Copy Markdown View Source

A listener or connection. Equivalent to NkPACKET's #nkport{}.

  • local_ip / local_port: the address of our socket.
  • remote_ip / remote_port: the peer, nil for listeners. For UDP, a port with a remote address is the listener socket "connected" to a peer.
  • listen_ip / listen_port: the listener this port belongs to (the one used as base for outgoing connections), to be used in Via and Contact headers.
  • pid: the owner process.
  • handler: {module, arg} receiving the messages, see Caracola.Transport.Handler.

Summary

Types

t()

A connection or listening port: transport, local, remote and listen addresses, its process and handler.

A transport protocol of a port.

Types

t()

@type t() :: %Caracola.Transport.Port{
  handler: Caracola.Transport.Handler.t() | nil,
  listen_ip: :inet.ip_address() | nil,
  listen_port: :inet.port_number() | nil,
  local_ip: :inet.ip_address() | nil,
  local_port: :inet.port_number() | nil,
  pid: pid() | nil,
  remote_ip: :inet.ip_address() | nil,
  remote_port: :inet.port_number() | nil,
  service: term(),
  socket: term(),
  transport: transport()
}

A connection or listening port: transport, local, remote and listen addresses, its process and handler.

transport()

@type transport() :: :udp | :tcp | :tls | :ws | :wss

A transport protocol of a port.