@@ -95,11 +95,11 @@ * A delegate for OFStream. */ @protocol OFStreamDelegate @optional /*! - * @brief This method is called when data was read asynchronously from the + * @brief This method is called when data was read asynchronously from a * stream. * * @param stream The stream on which data was read * @param buffer A buffer with the data that has been read * @param length The length of the data that has been read @@ -108,11 +108,11 @@ - (bool)stream: (OF_KINDOF(OFStream *))stream didReadIntoBuffer: (void *)buffer length: (size_t)length; /*! - * @brief This method is called when a line was read asynchronously from the + * @brief This method is called when a line was read asynchronously from a * stream. * * @param stream The stream on which a line was read * @param line The line which has been read or `nil` when the end of stream * occurred @@ -120,11 +120,11 @@ */ - (bool)stream: (OF_KINDOF(OFStream *))stream didReadLine: (nullable OFString *)line; /*! - * @brief This method is called when data was written asynchronously to the + * @brief This method is called when data was written asynchronously to a * stream. * * @param stream The stream to which data was written * @param buffer A pointer to the buffer which was written to the stream. This * can be changed to point to a different buffer to be used on the @@ -138,17 +138,27 @@ didWriteBuffer: (const void *_Nonnull *_Nonnull)buffer length: (size_t)length; /*! * @brief This method is called when an exception occurred during an - * asynchronous operation on the stream. + * asynchronous read on a stream. + * + * @param stream The stream for which an exception occurred + * @param exception The exception which occurred for the stream + */ +- (void)stream: (OF_KINDOF(OFStream *))stream + didFailToReadWithException: (id)exception; + +/*! + * @brief This method is called when an exception occurred during an + * asynchronous write on a stream. * * @param stream The stream for which an exception occurred * @param exception The exception which occurred for the stream */ -- (void)stream: (OF_KINDOF(OFStream *))stream - didFailWithException: (id)exception; +- (void)stream: (OF_KINDOF(OFStream *))stream + didFailToWriteWithException: (id)exception; @end /*! * @class OFStream OFStream.h ObjFW/OFStream.h *