# `TuningFork.Osc.Client`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.11/tuning_fork/lib/tuning_fork/osc/client.ex#L1)

A UDP socket for sending `TuningFork.Osc` messages, and reading them back.

    {:ok, client} = Osc.Client.start_link(host: "127.0.0.1", port: 57_120)
    Osc.Client.send(client, "/play", [60, 0.8])

# `t`

```elixir
@type t() :: GenServer.server()
```

# `bundle`

```elixir
@spec bundle(t(), [{String.t(), [term()]}], :now | DateTime.t()) :: :ok
```

Send several messages as one bundle under the time tag `at`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `packet`

```elixir
@spec packet(t(), binary()) :: :ok
```

Send bytes already encoded.

# `point`

```elixir
@spec point(t(), term(), pos_integer()) :: :ok
```

Point the client somewhere else.

# `send`

```elixir
@spec send(t(), String.t(), [term()]) :: :ok
```

Send one message.

# `start_link`

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

Open a socket.

With `:listen`, every message that arrives is sent to `:owner` as
`{:osc, address, args, {from_host, from_port}}`; a packet that does not decode as a
message is dropped.

## Options

  * `:host` — where to send, a charlist, binary or tuple. Default `"127.0.0.1"`
  * `:port` — which port to send to. Default 57120
  * `:listen` — bind this port and read as well as write. Default none
  * `:owner` — who to send what arrives to. Default whoever called
  * `:name` — register the client under a name

# `to`

```elixir
@spec to(t()) :: {term(), pos_integer()}
```

Where this client is sending, as `{host, port}`.

---

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