# Why is sys.get\_connectivity() always reporting NETWORK\_CONNECTED on macOS? (SOLVED)

**URL:** <https://forum.defold.com/t/why-is-sys-get-connectivity-always-reporting-network-connected-on-macos-solved/15660>\
**Category:** Questions\
**Created:** [January 12, 2018, 3:04am UTC](https://forum.defold.com/t/why-is-sys-get-connectivity-always-reporting-network-connected-on-macos-solved/15660 "2018-01-12T03:04:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshua.winters](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@joshua.winters](https://forum.defold.com/u/joshua.winters)\
**Post date:** [January 12, 2018, 3:04am UTC](https://forum.defold.com/t/why-is-sys-get-connectivity-always-reporting-network-connected-on-macos-solved/15660/1 "2018-01-12T03:04:21Z")

</div>

I am working on a network reachability native extension, so I can get callback notification in lua when the network reachability changed (BTW, Defold API does NOT provide such functionality, is it?)  
The native extension works pretty well on macOS. To verify if the native extension returns correct result, I called sys.get\_connectivity() for double check. But I found when I disalbed the Wi-Fi connection (the only network connection) on my macbook, sys.get\_connectivity() call still returns sys.NETWORK\_CONNECTED.  
Is it a bug or designed behavior?

I posted the log message below for your reference. (Reachability 0 means no conection, 1 means via cellular, 2 means other network connection). Thanks in advance.

INFO:DLIB: Log server started on port 50799  
INFO:ENGINE: Engine service started on port 50800  
INFO:ENGINE: Defold Engine 1.2.119 (2406775)  
INFO:ENGINE: Loading data from: build/default  
INFO:ENGINE: Initialised sound device ‘default’

INFO:DLIB: SSDP: Started on address 10.11.248.100  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
DEBUG:SCRIPT: main.script does not handle [proxy\_unloaded]  
INFO:DLIB: SSDP: Done on address 10.11.248.100  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 0  
DEBUG:SCRIPT: Reachability is changed to 0  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 0  
DEBUG:SCRIPT: Reachability is changed to 0  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED  
INFO:DLIB: SSDP: Started on address 10.11.248.100  
INFO:reachability: Reachability is changed to 2  
DEBUG:SCRIPT: Reachability is changed to 2  
DEBUG:SCRIPT: NETWORK\_CONNECTED

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [January 12, 2018, 6:51am UTC](https://forum.defold.com/t/why-is-sys-get-connectivity-always-reporting-network-connected-on-macos-solved/15660/2 "2018-01-12T06:51:04Z")

</div>

![2018-01-11 22_48_38-Welcome - Zeal](https://forum-defold-uploads.b-cdn.net/original/2X/3/312077752addc030c5a8278da61d862be3438109.png)

It’s intended.

There are other ways you can check for connectivity. For DefQuest I just check for time servers to respond.

---

<div class="post-metadata">

**Author:** ![joshua.winters](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@joshua.winters](https://forum.defold.com/u/joshua.winters)\
**Post date:** [January 12, 2018, 7:10am UTC](https://forum.defold.com/t/why-is-sys-get-connectivity-always-reporting-network-connected-on-macos-solved/15660/3 "2018-01-12T07:10:40Z")

</div>

Thanks @Pkeod for the clarification and tips, sorry I did not read the API reference carefully 😬
