'Close the connection to the HTTP server.'

def close(self):

    if self.sock:
        self.sock.close()
        self.sock = None
    if self.__response:
        self.__response.close()
        self.__response = None
    self.__state = _CS_IDLE
    return
