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

# Events

Various events are raised during the lifetime of an internet check. Events are very useful become they allow you to implement various different logics based on your requirements, when it comes to network status detection. You can listen to them from as many scripts as you want.

{% hint style="warning" %}
M**ake sure to not listen to events twice from the same script, or keep listening to them when not wanted.**
{% endhint %}

### OnCheckStarted

This event is raised as soon as an internet check is started. It will be raised for **every** internet check, if you have started a continuous check.

You can listen/stop listening to this event this way:

```csharp
...

// Start listening
EazyNetChecker.OnCheckStarted += OnNetCheckStarted;

...

// Stop listening when you don't need it
EazyNetChecker.OnCheckStarted -= OnNetCheckStarted;

...

private void OnNetCheckStarted() 
{ 
    Debug.Log("Internet check just started"); 
}
```

### OnCheckFinished

This event is raised as soon as an internet check is finished. It will be raised for **every** internet check, if you have started a continuous check.

You can listen/stop listening to this event this way:

```csharp
...

// Start listening
EazyNetChecker.OnCheckFinished += OnNetCheckFinished;

...

// Stop listening when you don't need it
EazyNetChecker.OnCheckFinished -= OnNetCheckFinished;

...

private void OnNetCheckFinished() 
{ 
    Debug.Log("Internet check just finished with status " + EazyNetChecker.Status); 
}
```

### OnConnectionStatusChanged

This event is raised as soon as an internet check is finished and a different connection status is detected. You can use this event to act accordingly if the connection status changes and you want to handle connection-specific logic.

You can listen/stop listening to this event this way:

```csharp
...

// Start listening
EazyNetChecker.OnConnectionStatusChanged += OnNetConnectionStatusChanged;

...

// Stop listening when you don't need it
EazyNetChecker.OnConnectionStatusChanged -= OnNetConnectionStatusChanged;

...

private void OnNetConnectionStatusChanged() 
{ 
    Debug.Log("Internet status changed to " + EazyNetChecker.Status); 
}
```

### OnCheckTimeout

This event is raised when an internet check times out. An internet check will time out if it is not able to detect the internet connection status within the specified timeout period.

You can listen/stop listening to this event this way:

```csharp
...

// Start listening
EazyNetChecker.OnCheckTimeout += OnNetCheckTimeout;

...

// Stop listening when you don't need it
EazyNetChecker.OnCheckTimeout -= OnNetCheckTimeout;

...

private void OnNetCheckTimeout() 
{ 
    Debug.Log("Check timed out! Unable to determine internet connection"); 
}
```


---

# 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:

```
GET https://hellmadegames.gitbook.io/eazy-netchecker/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
