@@ -21,17 +21,17 @@ #import "socket.h" OF_ASSUME_NONNULL_BEGIN -/*! @file */ +/** @file */ @class OFData; @class OFDatagramSocket; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief A block which is called when a packet has been received. * * @param length The length of the packet * @param sender The address of the sender of the packet * @param exception An exception which occurred while receiving or `nil` on @@ -40,11 +40,11 @@ */ typedef bool (^of_datagram_socket_async_receive_block_t)( size_t length, const of_socket_address_t *_Nonnull sender, id _Nullable exception); -/*! +/** * @brief A block which is called when a packet has been sent. * * @param data The data which was sent * @param receiver The receiver for the packet * @param exception An exception which occurred while reading or `nil` on @@ -54,19 +54,19 @@ typedef OFData *_Nullable (^of_datagram_socket_async_send_data_block_t)( OFData *_Nonnull data, const of_socket_address_t *_Nonnull receiver, id _Nullable exception); #endif -/*! +/** * @protocol OFDatagramSocketDelegate OFDatagramSocket.h \ * ObjFW/OFDatagramSocket.h * * @brief A delegate for OFDatagramSocket. */ @protocol OFDatagramSocketDelegate @optional -/*! +/** * @brief This method is called when a packet has been received. * * @param socket The datagram socket which received a packet * @param buffer The buffer the packet has been written to * @param length The length of the packet @@ -79,11 +79,11 @@ didReceiveIntoBuffer: (void *)buffer length: (size_t)length sender: (const of_socket_address_t *_Nonnull)sender exception: (nullable id)exception; -/*! +/** * @brief This method is called when a packet has been sent. * * @param socket The datagram socket which sent a packet * @param data The data which was sent * @param receiver The receiver for the packet @@ -94,11 +94,11 @@ didSendData: (OFData *)data receiver: (const of_socket_address_t *_Nonnull)receiver exception: (nullable id)exception; @end -/*! +/** * @class OFDatagramSocket OFDatagramSocket.h ObjFW/OFDatagramSocket.h * * @brief A base class for datagram sockets. * * @warning Even though the OFCopying protocol is implemented, it does *not* @@ -118,39 +118,39 @@ #endif id _Nullable _delegate; OF_RESERVE_IVARS(OFDatagramSocket, 4) } -/*! +/** * @brief Whether the socket can block. * * By default, a socket can block. */ @property (nonatomic) bool canBlock; -/*! +/** * @brief Whether the socket can send to broadcast addresses. */ @property (nonatomic) bool canSendToBroadcastAddresses; -/*! +/** * @brief The delegate for asynchronous operations on the socket. * * @note The delegate is retained for as long as asynchronous operations are * still ongoing. */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id delegate; -/*! +/** * @brief Returns a new, autoreleased OFDatagramSocket. * * @return A new, autoreleased OFDatagramSocket */ + (instancetype)socket; -/*! +/** * @brief Receives a datagram and stores it into the specified buffer. * * If the buffer is too small, the datagram is truncated. * * @param buffer The buffer to write the datagram to @@ -161,11 +161,11 @@ */ - (size_t)receiveIntoBuffer: (void *)buffer length: (size_t)length sender: (of_socket_address_t *)sender; -/*! +/** * @brief Asynchronously receives a datagram and stores it into the specified * buffer. * * If the buffer is too small, the datagram is truncated. * @@ -173,11 +173,11 @@ * @param length The length of the buffer */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length; -/*! +/** * @brief Asynchronously receives a datagram and stores it into the specified * buffer. * * If the buffer is too small, the datagram is truncated. * @@ -188,11 +188,11 @@ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief Asynchronously receives a datagram and stores it into the specified * buffer. * * If the buffer is too small, the datagram is truncated. * @@ -207,11 +207,11 @@ */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length block: (of_datagram_socket_async_receive_block_t)block; -/*! +/** * @brief Asynchronously receives a datagram and stores it into the specified * buffer. * * If the buffer is too small, the datagram is truncated. * @@ -229,11 +229,11 @@ length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_datagram_socket_async_receive_block_t)block; #endif -/*! +/** * @brief Sends the specified datagram to the specified address. * * @param buffer The buffer to send as a datagram * @param length The length of the buffer * @param receiver A pointer to an @ref of_socket_address_t to which the @@ -241,21 +241,21 @@ */ - (void)sendBuffer: (const void *)buffer length: (size_t)length receiver: (const of_socket_address_t *)receiver; -/*! +/** * @brief Asynchronously sends the specified datagram to the specified address. * * @param data The data to send as a datagram * @param receiver A pointer to an @ref of_socket_address_t to which the * datagram should be sent. The receiver is copied. */ - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver; -/*! +/** * @brief Asynchronously sends the specified datagram to the specified address. * * @param data The data to send as a datagram * @param receiver A pointer to an @ref of_socket_address_t to which the * datagram should be sent. The receiver is copied. @@ -264,11 +264,11 @@ - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver runLoopMode: (of_run_loop_mode_t)runLoopMode; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief Asynchronously sends the specified datagram to the specified address. * * @param data The data to send as a datagram * @param receiver A pointer to an @ref of_socket_address_t to which the * datagram should be sent. The receiver is copied. @@ -278,11 +278,11 @@ */ - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver block: (of_datagram_socket_async_send_data_block_t)block; -/*! +/** * @brief Asynchronously sends the specified datagram to the specified address. * * @param data The data to send as a datagram * @param receiver A pointer to an @ref of_socket_address_t to which the * datagram should be sent. The receiver is copied. @@ -295,18 +295,18 @@ receiver: (const of_socket_address_t *)receiver runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_datagram_socket_async_send_data_block_t)block; #endif -/*! +/** * @brief Cancels all pending asynchronous requests on the socket. */ - (void)cancelAsyncRequests; -/*! +/** * @brief Closes the socket so that it can neither receive nor send any more * datagrams. */ - (void)close; @end OF_ASSUME_NONNULL_END