def METHOD_NAME(self, addr, socket_type):
    # type: (str, socket.AddressFamily) -> float
    with closing(socket.socket(socket_type)) as sock:
        sock.settimeout(self.timeout)
        start = get_precise_time()
        sock.METHOD_NAME((addr, self.port))
        response_time = get_precise_time() - start
        return response_time