Answers for "Laravel check redis connection"

3

check connection c#

public static bool CheckForInternetConnection()
{
    try
    {
        using (var client = new WebClient())
            using (client.OpenRead("http://google.com/generate_204")) 
                return true; 
    }
    catch
    {
        return false;
    }
}
Posted by: Guest on June-12-2020
1

python check internet connection

import urllib2

def internet_on():
    try:
        urllib2.urlopen('http://216.58.192.142', timeout=1)
        return True
    except urllib2.URLError as err: 
        return False
Posted by: Guest on June-27-2020

Python Answers by Framework

Browse Popular Code Answers by Language