How to detect loss of Internet or Network Connectivity

We are using the Chunkdownloader plugin to manage and download assets for our mobile games . Our requirement is to notify the user if he /she looses network connectivity for a certain duration . Is there a way that we can detect loss of network connectivity ?

You could either use the mobile devices’ built-in APIs or take a look at this free TCP Socket plugin.