> 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://owo-game.gitbook.io/owo-api/welcome/connection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
