> For the complete documentation index, see [llms.txt](https://owo-game.gitbook.io/owo-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://owo-game.gitbook.io/owo-api/welcome/connection.md).

# Connection

{% hint style="info" %}
For those using Unreal Engine, click [here](/owo-api/unreal-developers.md).
{% endhint %}

{% hint style="danger" %}

#### C++ Extra Step

You need to call the `UpdateStatus` method in a loop passing the total time since program start up in milliseconds as an argument.&#x20;

```cpp
owo->UpdateStatus(timeSinceStartInMilliseconds);
```

This method is responsible of managing the connection state and the sensations priority queue. As such, we recommend calling this function in the main loop of your project.
{% endhint %}

### 1. Manual Connection

This method allows to connect to a fixed IP by passing it as a parameter.

{% tabs %}
{% tab title="C#" %}

```csharp
OWO.Connect(singleIp);
```

{% endtab %}

{% tab title="C++" %}

```cpp
owo->Connect({ip});
```

{% endtab %}
{% endtabs %}

You can also connect to more than one IP on the same game. Sending the same sensations to multiple devices.

{% tabs %}
{% tab title="C#" %}

```csharp
OWO.Connect(ip1, ip2, ip3);
```

{% endtab %}

{% tab title="C++" %}

```cpp
owo->Connect({ip1, ip2, ip3});
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Make sure that any IP you use is in the same network.
{% endhint %}

### 2. Automatic Connection

This method allows for the connection to be established with any MyOWO app that is in the same network as your project.&#x20;

{% tabs %}
{% tab title="C#" %}

```csharp
OWO.AutoConnect();
```

{% endtab %}

{% tab title="C++" %}
{% code fullWidth="true" %}

```cpp
owo->AutoConnect();
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
This may not work if there is a VPN open in the background or if the network does not allow broadcast communication.&#x20;

We recommend that you allow your user to use the manual connection option.
{% endhint %}

### 3. IP Scanning

This method will scan the local network in search of any MyOWO app that is scanning.

{% tabs %}
{% tab title="C#" %}

```csharp
OWO.StartScan();
```

{% endtab %}

{% tab title="C++" %}

```cpp
#include <chrono>
owo->Scan(std::clock());
```

{% endtab %}
{% endtabs %}

You can readily retrieve the scanned IPs from the `DiscoveredApps` property.

{% tabs %}
{% tab title="C#" %}

```csharp
OWO.DiscoveredApps;
```

{% endtab %}

{% tab title="C++" %}

```cpp
owo->DiscoveredApps();
```

{% endtab %}
{% endtabs %}

### 4. Disconnection

By using this method, you can close the connection with the MyOWO app.

{% tabs %}
{% tab title="C#" %}

```csharp
OWO.Disconnect();
```

{% endtab %}

{% tab title="C++" %}

```cpp
owo->Disconnect();
```

{% endtab %}
{% endtabs %}
