Table of Contents

Class NetworkModule

Namespace
Titipi.MocaLib

Provides internet connectivity checking and background polling. Exposes a one-shot CheckInternetConnectionAvailable() for on-demand checks, and a polling loop that fires OnInternetStatusChanged when reachability changes. The polling loop automatically pauses when the app is backgrounded.

public static class NetworkModule
Inheritance
NetworkModule
Inherited Members

Properties

IsInitialized

Whether the module has been successfully initialized.

IsInternetAvailable

The connectivity state as of the most recent poll.

Initialization

Initialize()

Creates the MonoBehaviour runner that handles app pause/resume lifecycle.

Methods

CheckInternetConnectionAvailable()

Pings multiple DNS endpoints in parallel and returns true as soon as any responds. Returns false immediately if Application.internetReachability is NotReachable.

Disable()

Stops the polling loop and clears all OnInternetStatusChanged subscribers.

Enable(float, int)

Starts the background polling loop.

Events

OnInternetStatusChanged

Fired when connectivity transitions from available to unavailable or vice versa.