Beispiel #1
0
def isconnected(ping_url):
    """Whether the client application is connected to the Internet."""
    try:
        head_request(ping_url)
        return True
    except NetworkError:
        return False
Beispiel #2
0
def isready(ping_url):
    """Whether the server is ready to receive synchronization
    requests."""
    try:
        code, reason = head_request(ping_url)
        return code // 100 == 2
    except:
        return False