How to learn internet connection lost?

Hi all,

Is there any way to learn when internet connection lost ? Generating event callback or something like that

Thanks for any help.