# `NodeWire.Conn`
[🔗](https://github.com/c2bw/nodewire/blob/v0.1.0/lib/node_wire/conn.ex#L1)

Immutable snapshot of one connection instance.

`:id` changes on every connection attempt. `:identity` is the server-assigned
authenticated identity. `:protocol`, `:protocol_version` and `:capabilities`
describe negotiation; `:phase` describes application readiness. `:peer` is the
remote IP address and port, when known. `:endpoint` is the atom name, `nil` for
unnamed endpoints, or `:unnamed` for tuple-based names. `:role` is `:server`
or `:client`.

During authentication/handshake callbacks, negotiated fields may still be
`nil`. Snapshots do not update in place and can become stale immediately.
Use `NodeWire.Connection.notify/3` for asynchronous work scoped to this instance.
`:owner` and `:admission` are internal routing handles; do not inspect or use
them directly. Snapshots contain neither sockets nor credentials.

# `t`

```elixir
@type t() :: %NodeWire.Conn{
  admission: pid() | nil,
  capabilities: [String.t()],
  endpoint: atom() | nil,
  id: reference() | nil,
  identity: String.t() | nil,
  owner: pid() | nil,
  peer: %{address: :inet.ip_address(), port: :inet.port_number()} | nil,
  phase: NodeWire.phase() | nil,
  protocol: module() | nil,
  protocol_version: pos_integer() | nil,
  role: :client | :server | nil
}
```

---

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