# `Cauldron2D.Beacon.Listener`
[🔗](https://github.com/jaman/cauldron/blob/v0.1.3/cauldron_2d/lib/cauldron_2d/beacon/listener.ex#L1)

Hears the servers of one game calling on the local network (`Cauldron2D.Beacon`) and
keeps those heard in the last six seconds.

    {:ok, _} = Cauldron2D.Beacon.Listener.start_link(game: :my_game)
    Cauldron2D.Beacon.Listener.found()

## Options

  * `:game` — the game whose servers to keep; others' calls are ignored. Required
  * `:port` — the UDP port. Default `Cauldron2D.Beacon.port/0`
  * `:name` — the process name. Default the module, `nil` for none

A port it cannot open leaves it deaf, hearing nothing.

# `server`

```elixir
@type server() :: %{
  game: String.t(),
  host: String.t(),
  http: String.t() | nil,
  node: atom() | nil,
  from: :inet.ip_address(),
  heard: integer()
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `found`

```elixir
@spec found(GenServer.server()) :: [server()]
```

The servers heard in the last six seconds, the latest first.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Start listening; see the module documentation for the options.

---

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