Checking internetReachability from another Thread

I have to check internet reachability from a separate thread (which is activated every N seconds, and check for reachability, so i cannot cache the reachability before starting the thread)

  1. I have to do this job in a separate thread and not in a coroutine / monobehaviour

  2. I Can’t use Application.internetReachability or the Ping class, as they don’t work on a separate thread

  3. The .net Ping class seem to have a bug in the mono version distributed with unity and raises an exception all the time.

i want to avoid having a monobehavior just to check reachability, as it would be a library and i wanted to avoid using the unity runloop when possible.

Any suggestions on a possible solution?

Please check this Stack Overflow question and my answer to similar question build on top of the SO one. It is independent from Unity classes, so can be used on separate thread.

Using test result, you can update a bool field/property which is visible in the main thread.