@@ -21,17 +21,17 @@ #import "socket.h" OF_ASSUME_NONNULL_BEGIN -/*! @file */ +/** @file */ @class OFData; @class OFSequencedPacketSocket; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief A block which is called when a packet has been received. * * @param length The length of the packet * @param exception An exception which occurred while receiving or `nil` on * success @@ -38,11 +38,11 @@ * @return A bool whether the same block should be used for the next receive */ typedef bool (^of_sequenced_packet_socket_async_receive_block_t)(size_t length, id _Nullable exception); -/*! +/** * @brief A block which is called when a packet has been sent. * * @param data The data which was sent * @param exception An exception which occurred while reading or `nil` on * success @@ -49,11 +49,11 @@ * @return The data to repeat the send with or nil if it should not repeat */ typedef OFData *_Nullable (^of_sequenced_packet_socket_async_send_data_block_t)( OFData *_Nonnull data, id _Nullable exception); -/*! +/** * @brief A block which is called when the socket accepted a connection. * * @param acceptedSocket The socket which has been accepted * @param exception An exception which occurred while accepting the socket or * `nil` on success @@ -62,19 +62,19 @@ */ typedef bool (^of_sequenced_packet_socket_async_accept_block_t)( OFSequencedPacketSocket *acceptedSocket, id _Nullable exception); #endif -/*! +/** * @protocol OFSequencedPacketSocketDelegate OFSequencedPacketSocket.h \ * ObjFW/OFSequencedPacketSocket.h * * @brief A delegate for OFSequencedPacketSocket. */ @protocol OFSequencedPacketSocketDelegate @optional -/*! +/** * @brief This method is called when a packet has been received. * * @param socket The sequenced packet socket which received a packet * @param buffer The buffer the packet has been written to * @param length The length of the packet @@ -85,11 +85,11 @@ - (bool)socket: (OFSequencedPacketSocket *)socket didReceiveIntoBuffer: (void *)buffer length: (size_t)length exception: (nullable id)exception; -/*! +/** * @brief This method is called when a packet has been sent. * * @param socket The sequenced packet socket which sent a packet * @param data The data which was sent * @param exception An exception that occurred while sending, or nil on success @@ -97,11 +97,11 @@ */ - (nullable OFData *)socket: (OFSequencedPacketSocket *)socket didSendData: (OFData *)data exception: (nullable id)exception; -/*! +/** * @brief A method which is called when a socket accepted a connection. * * @param socket The socket which accepted the connection * @param acceptedSocket The socket which has been accepted * @param exception An exception that occurred while accepting, or nil on @@ -111,11 +111,11 @@ - (bool)socket: (OFSequencedPacketSocket *)socket didAcceptSocket: (OFSequencedPacketSocket *)acceptedSocket exception: (nullable id)exception; @end -/*! +/** * @class OFSequencedPacketSocket OFSequencedPacketSocket.h \ * ObjFW/OFSequencedPacketSocket.h * * @brief A base class for sequenced packet sockets. * @@ -134,46 +134,46 @@ of_socket_address_t _remoteAddress; id _Nullable _delegate; OF_RESERVE_IVARS(OFSequencedPacketSocket, 4) } -/*! +/** * @brief Whether the socket can block. * * By default, a socket can block. */ @property (nonatomic) bool canBlock; -/*! +/** * @brief Whether the socket is a listening socket. */ @property (readonly, nonatomic, getter=isListening) bool listening; -/*! +/** * @brief The remote address. * * @note This only works for accepted sockets! */ @property (readonly, nonatomic) const of_socket_address_t *remoteAddress; -/*! +/** * @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 OFSequencedPacketSocket. * * @return A new, autoreleased OFSequencedPacketSocket */ + (instancetype)socket; -/*! +/** * @brief Receives a packet and stores it into the specified buffer. * * If the buffer is too small, the receive operation fails. * * @param buffer The buffer to write the packet to @@ -181,11 +181,11 @@ * @return The length of the received packet */ - (size_t)receiveIntoBuffer: (void *)buffer length: (size_t)length; -/*! +/** * @brief Asynchronously receives a packet and stores it into the specified * buffer. * * If the buffer is too small, the receive operation fails. * @@ -193,11 +193,11 @@ * @param length The length of the buffer */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length; -/*! +/** * @brief Asynchronously receives a packet and stores it into the specified * buffer. * * If the buffer is too small, the receive operation fails. * @@ -208,11 +208,11 @@ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief Asynchronously receives a packet and stores it into the specified * buffer. * * If the buffer is too small, the receive operation fails. * @@ -228,11 +228,11 @@ asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length block: (of_sequenced_packet_socket_async_receive_block_t) block; -/*! +/** * @brief Asynchronously receives a packet and stores it into the specified * buffer. * * If the buffer is too small, the receive operation fails. * @@ -251,37 +251,37 @@ runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_sequenced_packet_socket_async_receive_block_t) block; #endif -/*! +/** * @brief Sends the specified packet. * * @param buffer The buffer to send as a packet * @param length The length of the buffer */ - (void)sendBuffer: (const void *)buffer length: (size_t)length; -/*! +/** * @brief Asynchronously sends the specified packet. * * @param data The data to send as a packet */ - (void)asyncSendData: (OFData *)data; -/*! +/** * @brief Asynchronously sends the specified packet. * * @param data The data to send as a packet * @param runLoopMode The run loop mode in which to perform the async send */ - (void)asyncSendData: (OFData *)data runLoopMode: (of_run_loop_mode_t)runLoopMode; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief Asynchronously sends the specified packet. * * @param data The data to send as a packet * @param block The block to call when the packet has been sent. It should * return the data for the next send with the same callback or nil @@ -289,11 +289,11 @@ */ - (void)asyncSendData: (OFData *)data block: (of_sequenced_packet_socket_async_send_data_block_t) block; -/*! +/** * @brief Asynchronously sends the specified packet. * * @param data The data to send as a packet * @param runLoopMode The run loop mode in which to perform the async send * @param block The block to call when the packet has been sent. It should @@ -304,53 +304,53 @@ runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_sequenced_packet_socket_async_send_data_block_t) block; #endif -/*! +/** * @brief Listen on the socket. * * @param backlog Maximum length for the queue of pending connections. */ - (void)listenWithBacklog: (int)backlog; -/*! +/** * @brief Listen on the socket. */ - (void)listen; -/*! +/** * @brief Accept an incoming connection. * * @return An autoreleased sequenced packet socket for the accepted connection. */ - (instancetype)accept; -/*! +/** * @brief Asynchronously accept an incoming connection. */ - (void)asyncAccept; -/*! +/** * @brief Asynchronously accept an incoming connection. * * @param runLoopMode The run loop mode in which to perform the async accept */ - (void)asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; #ifdef OF_HAVE_BLOCKS -/*! +/** * @brief Asynchronously accept an incoming connection. * * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ - (void)asyncAcceptWithBlock: (of_sequenced_packet_socket_async_accept_block_t)block; -/*! +/** * @brief Asynchronously accept an incoming connection. * * @param runLoopMode The run loop mode in which to perform the async accept * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted @@ -358,18 +358,18 @@ */ - (void)asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_sequenced_packet_socket_async_accept_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