@@ -66,16 +66,15 @@ /*! The server refused the query */ OF_DNS_RESOLVER_ERROR_SERVER_REFUSED } of_dns_resolver_error_t; /*! - * @protocol OFDNSResolverDelegate OFDNSResolver.h ObjFW/OFDNSResolver.h + * @protocol OFDNSResolverQueryDelegate OFDNSResolver.h ObjFW/OFDNSResolver.h * - * @brief A delegate for OFDNSResolver. + * @brief A delegate for performed DNS queries. */ -@protocol OFDNSResolverDelegate -@optional +@protocol OFDNSResolverQueryDelegate /*! * @brief This method is called when a DNS resolver performed a query. * * @param resolver The acting resolver * @param query The query performed by the resolver @@ -85,11 +84,18 @@ */ - (void)resolver: (OFDNSResolver *)resolver didPerformQuery: (OFDNSQuery *)query response: (nullable OFDNSResponse *)response exception: (nullable id)exception; +@end +/*! + * @protocol OFDNSResolverQueryDelegate OFDNSResolver.h ObjFW/OFDNSResolver.h + * + * @brief A delegate for resolved hosts. + */ +@protocol OFDNSResolverHostDelegate /*! * @brief This method is called when a DNS resolver resolved a host to * addresses. * * @param resolver The acting resolver @@ -197,11 +203,11 @@ * * @param query The query to perform * @param delegate The delegate to use for callbacks */ - (void)asyncPerformQuery: (OFDNSQuery *)query - delegate: (id )delegate; + delegate: (id )delegate; /*! * @brief Asynchronously performs the specified query. * * @param query The query to perform @@ -208,20 +214,20 @@ * @param runLoopMode The run loop mode in which to resolve * @param delegate The delegate to use for callbacks */ - (void)asyncPerformQuery: (OFDNSQuery *)query runLoopMode: (of_run_loop_mode_t)runLoopMode - delegate: (id )delegate; + delegate: (id )delegate; /*! * @brief Asynchronously resolves the specified host to socket addresses. * * @param host The host to resolve * @param delegate The delegate to use for callbacks */ - (void)asyncResolveAddressesForHost: (OFString *)host - delegate: (id )delegate; + delegate: (id )delegate; /*! * @brief Asynchronously resolves the specified host to socket addresses. * * @param host The host to resolve @@ -228,11 +234,11 @@ * @param addressFamily The desired socket address family * @param delegate The delegate to use for callbacks */ - (void)asyncResolveAddressesForHost: (OFString *)host addressFamily: (of_socket_address_family_t)addressFamily - delegate: (id )delegate; + delegate: (id )delegate; /*! * @brief Asynchronously resolves the specified host to socket addresses. * * @param host The host to resolve @@ -241,11 +247,11 @@ * @param delegate The delegate to use for callbacks */ - (void)asyncResolveAddressesForHost: (OFString *)host addressFamily: (of_socket_address_family_t)addressFamily runLoopMode: (of_run_loop_mode_t)runLoopMode - delegate: (id )delegate; + delegate: (id )delegate; /*! * @brief Synchronously resolves the specified host to socket addresses. * * @param host The host to resolve