# `Caracola.Transport.Port`
[🔗](https://github.com/netkubes/caracola/blob/v0.1.0-rc.1/lib/caracola/transport/port.ex#L1)

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`.

# `t`

```elixir
@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`

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

A transport protocol of a port.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
