@@ -26,23 +26,10 @@ /*! @file */ @class OFUDPSocket; #ifdef OF_HAVE_BLOCKS -/*! - * @brief A block which is called when the host / port pair for the UDP socket - * has been resolved. - * - * @param host The host that has been resolved - * @param port The port of the host / port pair - * @param address The address of the resolved host / port pair - * @param exception An exception which occurred while resolving or `nil` on - * success - */ -typedef void (^of_udp_socket_async_resolve_block_t)(OFString *host, - uint16_t port, of_socket_address_t address, id _Nullable exception); - /*! * @brief A block which is called when a packet has been received. * * @param socket The UDP socket which received a packet * @param buffer The buffer the packet has been written to @@ -82,16 +69,16 @@ /*! * @class OFUDPSocket OFUDPSocket.h ObjFW/OFUDPSocket.h * * @brief A class which provides methods to create and use UDP sockets. * - * Addresses are of type @ref of_socket_address_t. You can use - * @ref resolveAddressForHost:port:address: to create an address for a host / - * port pair and @ref of_socket_address_ip_string to get the IP string / port - * pair for an address. If you want to compare two addresses, you can use - * @ref of_socket_address_equal and you can use @ref of_socket_address_hash to - * get a hash to use in e.g. @ref OFMapTable. + * Addresses are of type @ref of_socket_address_t. You can use the current + * thread's @ref OFDNSResolver to create an address for a host / port pair and + * @ref of_socket_address_ip_string to get the IP string / port pair for an + * address. If you want to compare two addresses, you can use @ref + * of_socket_address_equal and you can use @ref of_socket_address_hash to get a + * hash to use in e.g. @ref OFMapTable. * * @warning Even though the OFCopying protocol is implemented, it does *not* * return an independent copy of the socket, but instead retains it. * This is so that the socket can be used as a key for a dictionary, * so context can be associated with a socket. Using a socket in more @@ -120,58 +107,10 @@ * * @return A new, autoreleased OFUDPSocket */ + (instancetype)socket; -/*! - * @brief Resolves the specified host and creates a an address for the host / - * port pair. - * - * @param host The host to resolve - * @param port The port for the resulting address - * @param address A pointer to the address that should be filled with the - * host / port pair - */ -+ (void)resolveAddressForHost: (OFString *)host - port: (uint16_t)port - address: (of_socket_address_t *)address; - -#ifdef OF_HAVE_THREADS -/*! - * @brief Asynchronously resolves the specified host and creates an address for - * the host / port pair. - * - * @param host The host to resolve - * @param port The port for the resulting address - * @param target The target on which to call the selector once the host has been - * resolved - * @param selector The selector to call on the target. The signature must be - * `void (OFString *host, uint16_t port, - * of_socket_address_t address, id context, id exception)`. - * @param context A context object to pass along to the target - */ -+ (void)asyncResolveAddressForHost: (OFString *)host - port: (uint16_t)port - target: (id)target - selector: (SEL)selector - context: (nullable id)context; - -# ifdef OF_HAVE_BLOCKS -/*! - * @brief Asynchronously resolves the specified host and creates an address for - * the host / port pair. - * - * @param host The host to resolve - * @param port The port for the resulting address - * @param block The block to execute once the host has been resolved - */ -+ (void)asyncResolveAddressForHost: (OFString *)host - port: (uint16_t)port - block: (of_udp_socket_async_resolve_block_t)block; -# endif -#endif - /*! * @brief Binds the socket to the specified host and port. * * @param host The host to bind to. Use `@"0.0.0.0"` for IPv4 or `@"::"` for * IPv6 to bind to all.