'Set the default timeout, in seconds, of the connection.'

def set_timeout(self, timeout):

    try:
        timeout = int(timeout)
    except Exception:
        timeout = 0
    if (timeout <= 0):
        timeout = None
    socket.setdefaulttimeout(timeout)
