# Client

<a id="client-7"></a>

# Client

```cpp
#include <icy/symple/client.h>

class Client
```

[Defined in src/symple/include/icy/symple/client.h:88](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L88)

> **Inherits:** [`Stateful< ClientState >`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful), [`Signal< void(IPacket &)>`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)

Symple v4 client.

Connects to a Symple server over plain WebSocket (no Socket.IO). Handles authentication, presence, roster management, rooms, and message routing.

Usage: [smpl::Client](#client-7) client({ .host = "localhost", .port = 4500, .user = "alice", .name = "Alice" }); client.start();

client += packetSlot(&handler, &Handler::onMessage); client.Announce += slot(&handler, &Handler::onAnnounce);

Messages are emitted as polymorphic [IPacket](https://auscaster.com/icey/docs/api-reference/icy-IPacket.md#ipacket) via PacketSignal:

* [smpl::Message](https://auscaster.com/icey/docs/api-reference/icy-smpl-Message.md#message-12) (type "message")
* [smpl::Presence](https://auscaster.com/icey/docs/api-reference/icy-smpl-Presence.md#presence) (type "presence")
* [smpl::Event](https://auscaster.com/icey/docs/api-reference/icy-smpl-Event.md#event-2) (type "event")
* [smpl::Command](https://auscaster.com/icey/docs/api-reference/icy-smpl-Command.md#command) (type "command")

Use [packetSlot()](https://auscaster.com/icey/docs/api-reference/base.md#packetslot) with the specific type to filter.

## List of all members

| Name | Kind | Owner |
|------|------|-------|
| [`Announce`](#announce) | `variable` | Declared here |
| [`PeerConnected`](#peerconnected) | `variable` | Declared here |
| [`PeerDisconnected`](#peerdisconnected) | `variable` | Declared here |
| [`CreatePresence`](#createpresence) | `variable` | Declared here |
| [`Client`](#client-8) | `function` | Declared here |
| [`Client`](#client-9) | `function` | Declared here |
| [`~Client`](#client-10) | `function` | Declared here |
| [`start`](#start-30) | `function` | Declared here |
| [`stop`](#stop-19) | `function` | Declared here |
| [`send`](#send-18) | `function` | Declared here |
| [`send`](#send-19) | `function` | Declared here |
| [`respond`](#respond-1) | `function` | Declared here |
| [`sendPresence`](#sendpresence) | `function` | Declared here |
| [`sendPresence`](#sendpresence-1) | `function` | Declared here |
| [`joinRoom`](#joinroom) | `function` | Declared here |
| [`leaveRoom`](#leaveroom) | `function` | Declared here |
| [`isOnline`](#isonline) | `function` | Declared here |
| [`ourID`](#ourid) | `function` | Declared here |
| [`ourPeer`](#ourpeer) | `function` | Declared here |
| [`rooms`](#rooms) | `function` | Declared here |
| [`roster`](#roster) | `function` | Declared here |
| [`options`](#options-13) | `function` | Declared here |
| [`setOptions`](#setoptions) | `function` | Declared here |
| [`setError`](#seterror-7) | `function` | Declared here |
| [`createPresence`](#createpresence-1) | `function` | Declared here |
| [`onPresenceData`](#onpresencedata) | `function` | Declared here |
| [`_data`](#_data-4) | `variable` | Declared here |
| [`doConnect`](#doconnect) | `function` | Declared here |
| [`onTransportError`](#ontransporterror) | `function` | Declared here |
| [`onSocketRecv`](#onsocketrecv-9) | `function` | Declared here |
| [`onSocketClose`](#onsocketclose-6) | `function` | Declared here |
| [`onSocketError`](#onsocketerror-4) | `function` | Declared here |
| [`onWelcome`](#onwelcome) | `function` | Declared here |
| [`onServerMessage`](#onservermessage) | `function` | Declared here |
| [`startReconnect`](#startreconnect) | `function` | Declared here |
| [`reset`](#reset-24) | `function` | Declared here |
| [`syncDesiredRooms`](#syncdesiredrooms) | `function` | Declared here |
| [`sendJson`](#sendjson) | `function` | Declared here |
| [`buildUrl`](#buildurl) | `function` | Declared here |
| [`StateChange`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#statechange) | `variable` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful-1) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`~Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful-2) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`stateEquals`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateequals) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`stateBetween`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#statebetween) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`state`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#state-4) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`state`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#state-5) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`_state`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#_state) | `variable` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`beforeStateChange`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#beforestatechange) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`onStateChange`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#onstatechange-2) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`setState`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#setstate) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |
| [`setState`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#setstate-1) | `function` | Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful) |

## Inherited from [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful)

| Kind | Name | Description |
|------|------|-------------|
| `variable` | [`StateChange`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#statechange)  | Signals when the state changes. |
| `function` | [`Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful-1) `inline` |  |
| `function` | [`~Stateful`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful-2) `virtual` `inline` |  |
| `function` | [`stateEquals`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateequals) `virtual` `const` `inline` | Returns true if the current state ID equals the given ID. |
| `function` | [`stateBetween`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#statebetween) `virtual` `const` `inline` | Returns true if the current state ID is in the inclusive range [lid, rid]. |
| `function` | [`state`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#state-4) `virtual` `inline` | Returns a mutable reference to the current state. |
| `function` | [`state`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#state-5) `virtual` `const` `inline` | Returns a copy of the current state. |
| `variable` | [`_state`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#_state)  |  |
| `function` | [`beforeStateChange`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#beforestatechange) `virtual` `inline` | Override to handle pre state change logic. Return false to prevent state change. |
| `function` | [`onStateChange`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#onstatechange-2) `virtual` `inline` | Override to handle post state change logic. |
| `function` | [`setState`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#setstate) `virtual` `inline` | Sets the state and sends the state signal if the state change was successful. |
| `function` | [`setState`](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#setstate-1) `virtual` `inline` | Sets the state and sends the state signal if the state change was successful. |

## Public Attributes

| Return | Name | Description |
|--------|------|-------------|
| [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void(const int &)> | [`Announce`](#announce)  | Authentication response status (200 = success, 401 = failed). |
| [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void([`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) &)> | [`PeerConnected`](#peerconnected)  | A peer has come online. |
| [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void([`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) &)> | [`PeerDisconnected`](#peerdisconnected)  | A peer has gone offline. |
| [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void([`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) &)> | [`CreatePresence`](#createpresence)  | Modify the outgoing peer object before presence broadcast. |

---

<a id="announce"></a>

### Announce

```cpp
Signal< void(const int &)> Announce
```

Type: [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void(const int &)>

[Defined in src/symple/include/icy/symple/client.h:175](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L175)

Authentication response status (200 = success, 401 = failed).

---

<a id="peerconnected"></a>

### PeerConnected

```cpp
Signal< void(Peer &)> PeerConnected
```

Type: [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void([`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) &)>

[Defined in src/symple/include/icy/symple/client.h:178](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L178)

A peer has come online.

---

<a id="peerdisconnected"></a>

### PeerDisconnected

```cpp
Signal< void(Peer &)> PeerDisconnected
```

Type: [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void([`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) &)>

[Defined in src/symple/include/icy/symple/client.h:181](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L181)

A peer has gone offline.

---

<a id="createpresence"></a>

### CreatePresence

```cpp
Signal< void(Peer &)> CreatePresence
```

Type: [`Signal`](https://auscaster.com/icey/docs/api-reference/icy-Signal.md#signal)< void([`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) &)>

[Defined in src/symple/include/icy/symple/client.h:184](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L184)

Modify the outgoing peer object before presence broadcast.

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`Client`](#client-8)  |  |
|  | [`Client`](#client-9)  | Default constructor with default [Options](https://auscaster.com/icey/docs/api-reference/icy-smpl-Client-Options.md#options-15). |
|  | [`~Client`](#client-10) `virtual` |  |
| `void` | [`start`](#start-30)  | Start the Symple client. |
| `void` | [`stop`](#stop-19)  | Stop the Symple client. |
| `ssize_t` | [`send`](#send-18) `virtual` | Send a Symple message. Sets the `from` field automatically. |
| `ssize_t` | [`send`](#send-19) `virtual` | Send a string message (parsed as JSON). |
| `ssize_t` | [`respond`](#respond-1) `virtual` | Swap to/from and send. |
| `ssize_t` | [`sendPresence`](#sendpresence) `virtual` | Broadcast presence to joined rooms. |
| `ssize_t` | [`sendPresence`](#sendpresence-1) `virtual` | Send directed presence to a specific peer. |
| `int` | [`joinRoom`](#joinroom) `virtual` | Join a room on the server. |
| `int` | [`leaveRoom`](#leaveroom) `virtual` | Leave a room on the server. |
| `bool` | [`isOnline`](#isonline) `const` | Return true if in Online state. |
| `std::string` | [`ourID`](#ourid) `const` | Return the session ID assigned by the server. |
| [`Peer`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Peer.md#peer-1) * | [`ourPeer`](#ourpeer)  | Return the local peer object (null if offline). |
| [`StringVec`](https://auscaster.com/icey/docs/api-reference/base.md#stringvec) | [`rooms`](#rooms) `const` | Return joined rooms. |
| [`Roster`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Roster.md#roster-2) & | [`roster`](#roster)  | Return the roster of online peers. |
| const [`Options`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Client-Options.md#options-15) & | [`options`](#options-13) `const` | Return the current client options. |
| `void` | [`setOptions`](#setoptions)  | Replace the client options while the client is closed. This is the only supported way to reconfigure a default-constructed client. |
| `void` | [`setError`](#seterror-7)  | Set an error and transition to [Error](https://auscaster.com/icey/docs/api-reference/icy-Error.md#error) state. |

---

<a id="client-8"></a>

### Client

```cpp
Client(const Options & options, uv::Loop * loop = uv::defaultLoop())
```

[Defined in src/symple/include/icy/symple/client.h:111](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L111)

---

<a id="client-9"></a>

### Client

```cpp
Client()
```

[Defined in src/symple/include/icy/symple/client.h:113](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L113)

Default constructor with default [Options](https://auscaster.com/icey/docs/api-reference/icy-smpl-Client-Options.md#options-15).

---

<a id="client-10"></a>

### ~Client

`virtual`

```cpp
virtual ~Client()
```

[Defined in src/symple/include/icy/symple/client.h:114](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L114)

---

<a id="start-30"></a>

### start

```cpp
void start()
```

[Defined in src/symple/include/icy/symple/client.h:117](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L117)

Start the Symple client.

---

<a id="stop-19"></a>

### stop

```cpp
void stop()
```

[Defined in src/symple/include/icy/symple/client.h:120](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L120)

Stop the Symple client.

---

<a id="send-18"></a>

### send

`virtual`

```cpp
virtual ssize_t send(Message & message)
```

[Defined in src/symple/include/icy/symple/client.h:124](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L124)

Send a Symple message. Sets the `from` field automatically.

---

<a id="send-19"></a>

### send

`virtual`

```cpp
virtual ssize_t send(const std::string & message)
```

[Defined in src/symple/include/icy/symple/client.h:127](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L127)

Send a string message (parsed as JSON).

---

<a id="respond-1"></a>

### respond

`virtual`

```cpp
virtual ssize_t respond(Message & message)
```

[Defined in src/symple/include/icy/symple/client.h:130](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L130)

Swap to/from and send.

---

<a id="sendpresence"></a>

### sendPresence

`virtual`

```cpp
virtual ssize_t sendPresence(bool probe = false)
```

[Defined in src/symple/include/icy/symple/client.h:133](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L133)

Broadcast presence to joined rooms.

---

<a id="sendpresence-1"></a>

### sendPresence

`virtual`

```cpp
virtual ssize_t sendPresence(const Address & to, bool probe = false)
```

[Defined in src/symple/include/icy/symple/client.h:136](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L136)

Send directed presence to a specific peer.

---

<a id="joinroom"></a>

### joinRoom

`virtual`

```cpp
virtual int joinRoom(const std::string & room)
```

[Defined in src/symple/include/icy/symple/client.h:139](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L139)

Join a room on the server.

---

<a id="leaveroom"></a>

### leaveRoom

`virtual`

```cpp
virtual int leaveRoom(const std::string & room)
```

[Defined in src/symple/include/icy/symple/client.h:142](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L142)

Leave a room on the server.

---

<a id="isonline"></a>

### isOnline

`const`

```cpp
bool isOnline() const
```

[Defined in src/symple/include/icy/symple/client.h:145](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L145)

Return true if in Online state.

---

<a id="ourid"></a>

### ourID

`const`

```cpp
std::string ourID() const
```

[Defined in src/symple/include/icy/symple/client.h:148](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L148)

Return the session ID assigned by the server.

---

<a id="ourpeer"></a>

### ourPeer

```cpp
Peer * ourPeer()
```

[Defined in src/symple/include/icy/symple/client.h:151](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L151)

Return the local peer object (null if offline).

---

<a id="rooms"></a>

### rooms

`const`

```cpp
StringVec rooms() const
```

[Defined in src/symple/include/icy/symple/client.h:154](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L154)

Return joined rooms.

---

<a id="roster"></a>

### roster

```cpp
Roster & roster()
```

[Defined in src/symple/include/icy/symple/client.h:157](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L157)

Return the roster of online peers.

---

<a id="options-13"></a>

### options

`const`

```cpp
const Options & options() const
```

[Defined in src/symple/include/icy/symple/client.h:160](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L160)

Return the current client options.

---

<a id="setoptions"></a>

### setOptions

```cpp
void setOptions(Options options)
```

[Defined in src/symple/include/icy/symple/client.h:165](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L165)

Replace the client options while the client is closed. This is the only supported way to reconfigure a default-constructed client.

#### Exceptions

| Exception | Description |
|-----------|-------------|
| `std::logic_error` | if the client is currently connecting, online, or reconnecting. |

---

<a id="seterror-7"></a>

### setError

```cpp
void setError(const std::string & error)
```

[Defined in src/symple/include/icy/symple/client.h:168](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L168)

Set an error and transition to [Error](https://auscaster.com/icey/docs/api-reference/icy-Error.md#error) state.

## Protected Methods

| Return | Name | Description |
|--------|------|-------------|
| `void` | [`createPresence`](#createpresence-1) `virtual` | Underlying connection state changed. Inherits StateChange from [Stateful<ClientState>](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful). |
| `void` | [`onPresenceData`](#onpresencedata) `virtual` |  |

---

<a id="createpresence-1"></a>

### createPresence

`virtual`

```cpp
virtual void createPresence(Presence & p)
```

[Defined in src/symple/include/icy/symple/client.h:190](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L190)

Underlying connection state changed. Inherits StateChange from [Stateful<ClientState>](https://auscaster.com/icey/docs/api-reference/icy-Stateful.md#stateful).

---

<a id="onpresencedata"></a>

### onPresenceData

`virtual`

```cpp
virtual void onPresenceData(const json::Value & data, bool whiny = false)
```

[Defined in src/symple/include/icy/symple/client.h:191](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L191)

## Private Attributes

| Return | Name | Description |
|--------|------|-------------|
| std::unique_ptr< [`ClientData`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Client-ClientData.md#clientdata) > | [`_data`](#_data-4)  |  |

---

<a id="_data-4"></a>

### _data

```cpp
std::unique_ptr< ClientData > _data
```

Type: std::unique_ptr< [`ClientData`](https://auscaster.com/icey/docs/api-reference/icy-smpl-Client-ClientData.md#clientdata) >

[Defined in src/symple/include/icy/symple/client.h:210](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L210)

## Private Methods

| Return | Name | Description |
|--------|------|-------------|
| `void` | [`doConnect`](#doconnect)  |  |
| `void` | [`onTransportError`](#ontransporterror)  |  |
| `void` | [`onSocketRecv`](#onsocketrecv-9)  |  |
| `void` | [`onSocketClose`](#onsocketclose-6)  |  |
| `void` | [`onSocketError`](#onsocketerror-4)  |  |
| `void` | [`onWelcome`](#onwelcome)  |  |
| `void` | [`onServerMessage`](#onservermessage)  |  |
| `void` | [`startReconnect`](#startreconnect)  |  |
| `void` | [`reset`](#reset-24)  |  |
| `void` | [`syncDesiredRooms`](#syncdesiredrooms)  |  |
| `ssize_t` | [`sendJson`](#sendjson)  |  |
| `std::string` | [`buildUrl`](#buildurl) `const` |  |

---

<a id="doconnect"></a>

### doConnect

```cpp
void doConnect()
```

[Defined in src/symple/include/icy/symple/client.h:196](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L196)

---

<a id="ontransporterror"></a>

### onTransportError

```cpp
void onTransportError(const icy::Error & error)
```

[Defined in src/symple/include/icy/symple/client.h:197](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L197)

---

<a id="onsocketrecv-9"></a>

### onSocketRecv

```cpp
void onSocketRecv(const std::string & data)
```

[Defined in src/symple/include/icy/symple/client.h:198](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L198)

---

<a id="onsocketclose-6"></a>

### onSocketClose

```cpp
void onSocketClose()
```

[Defined in src/symple/include/icy/symple/client.h:199](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L199)

---

<a id="onsocketerror-4"></a>

### onSocketError

```cpp
void onSocketError(const std::string & error)
```

[Defined in src/symple/include/icy/symple/client.h:200](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L200)

---

<a id="onwelcome"></a>

### onWelcome

```cpp
void onWelcome(const json::Value & msg)
```

[Defined in src/symple/include/icy/symple/client.h:201](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L201)

---

<a id="onservermessage"></a>

### onServerMessage

```cpp
void onServerMessage(const json::Value & msg)
```

[Defined in src/symple/include/icy/symple/client.h:202](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L202)

---

<a id="startreconnect"></a>

### startReconnect

```cpp
void startReconnect()
```

[Defined in src/symple/include/icy/symple/client.h:203](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L203)

---

<a id="reset-24"></a>

### reset

```cpp
void reset()
```

[Defined in src/symple/include/icy/symple/client.h:204](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L204)

---

<a id="syncdesiredrooms"></a>

### syncDesiredRooms

```cpp
void syncDesiredRooms()
```

[Defined in src/symple/include/icy/symple/client.h:205](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L205)

---

<a id="sendjson"></a>

### sendJson

```cpp
ssize_t sendJson(const json::Value & msg)
```

[Defined in src/symple/include/icy/symple/client.h:207](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L207)

---

<a id="buildurl"></a>

### buildUrl

`const`

```cpp
std::string buildUrl() const
```

[Defined in src/symple/include/icy/symple/client.h:208](https://github.com/auscaster/icey/blob/main/src/symple/include/icy/symple/client.h#L208)
