@@ -17,10 +17,12 @@ #import "OFObject.h" #import "OFKernelEventObserver.h" #import "socket.h" +OF_ASSUME_NONNULL_BEGIN + /*! @file */ @class OFUDPSocket; @class OFException; @@ -44,11 +46,12 @@ * @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_udp_socket_address_t address, OFException *exception); + uint16_t port, of_udp_socket_address_t address, + __nullable OFException *exception); /*! * @brief A block which is called when a packet has been received. * * @param socket The UDP which received a packet @@ -59,11 +62,11 @@ * success * @return A bool whether the same block should be used for the next receive */ typedef bool (^of_udp_socket_async_receive_block_t)(OFUDPSocket *socket, void *buffer, size_t length, of_udp_socket_address_t sender, - OFException *exception); + __nullable OFException *exception); #endif /*! * @class OFUDPSocket OFUDPSocket.h ObjFW/OFUDPSocket.h * @@ -72,12 +75,11 @@ * Addresses are of type @ref of_udp_socket_address_t. You can use @ref * getHost:andPort:forAddress: to create an address for a host / port pair and * @ref getHost:andPort:forAddress: to get the host / port pair for an address. * If you want to compare two addresses, you can use * @ref of_udp_socket_address_equal and you can use - * @ref of_udp_socket_address_hash to get a hash to use in e.g. - * @ref OFMapTable. + * @ref of_udp_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 @@ -150,12 +152,12 @@ * the host of the host / port pair. * @param port A pointer to an uint16_t. If it is not NULL, the port of the * host / port pair will be written to it. * @param address The address for which the host and port should be retrieved */ -+ (void)getHost: (OFString *__autoreleasing*)host - andPort: (uint16_t*)port ++ (void)getHost: (__nonnull OFString *__autoreleasing *__nullable)host + andPort: (__nullable uint16_t*)port forAddress: (of_udp_socket_address_t*)address; /*! * @brief Binds the socket to the specified host and port. * @@ -278,5 +280,7 @@ */ extern uint32_t of_udp_socket_address_hash(of_udp_socket_address_t *address); #ifdef __cplusplus } #endif + +OF_ASSUME_NONNULL_END