@@ -148,13 +148,13 @@ * @brief Asynchronously reads *at most* size bytes from the stream into a * buffer. * * On network streams, this might read less than the specified number of bytes. * If you want to read exactly the specified number of bytes, use - * @ref asyncReadIntoBuffer:exactLength:block:. Note that a read can even - * return 0 bytes - this does not necessarily mean that the stream ended, so - * you still need to check @ref isAtEndOfStream. + * @ref asyncReadIntoBuffer:exactLength:target:selector:context:. Note that a + * read can even return 0 bytes - this does not necessarily mean that the + * stream ended, so you still need to check @ref isAtEndOfStream. * * @note The stream must implement @ref fileDescriptorForReading and return a * valid file descriptor in order for this to work! * * @param buffer The buffer into which the data is read. @@ -167,23 +167,24 @@ * data has been received. If you want the next method in the * queue to handle the data received next, you need to return * false from the method. * @param selector The selector to call on the target. The signature must be * `bool (OFStream *stream, void *buffer, size_t length, - * OFException *exception)`. + * id context, OFException *exception)`. */ - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length target: (id)target - selector: (SEL)selector; + selector: (SEL)selector + context: (nullable id)context; /*! * @brief Asynchronously reads exactly the specified length bytes from the * stream into a buffer. * - * Unlike @ref asyncReadIntoBuffer:length:target:selector:, this method does - * not call the method when less than the specified length has been read - + * Unlike @ref asyncReadIntoBuffer:length:target:selector:context:, this method + * does not call the method when less than the specified length has been read - * instead, it waits until it got exactly the specified length, the stream has * ended or an exception occurred. * * @note The stream must implement @ref fileDescriptorForReading and return a * valid file descriptor in order for this to work! @@ -197,16 +198,17 @@ * data has been received. If you want the next method in the * queue to handle the data received next, you need to return * false from the method. * @param selector The selector to call on the target. The signature must be * `bool (OFStream *stream, void *buffer, size_t size, - * OFException *exception)`. + * id context, OFException *exception)`. */ - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length target: (id)target - selector: (SEL)selector; + selector: (SEL)selector + context: (nullable id)context; # ifdef OF_HAVE_BLOCKS /*! * @brief Asynchronously reads *at most* ref size bytes from the stream into a * buffer. @@ -619,15 +621,16 @@ * been received. If the method returns true, it will be called * again when the next line has been received. If you want the * next method in the queue to handle the next line, you need to * return false from the method * @param selector The selector to call on the target. The signature must be - * `bool (OFStream *stream, OFString *line, + * `bool (OFStream *stream, OFString *line, id context, * OFException *exception)`. */ - (void)asyncReadLineWithTarget: (id)target - selector: (SEL)selector; + selector: (SEL)selector + context: (nullable id)context; /*! * @brief Asynchronously reads with the specified encoding until a newline, * `\0`, end of stream or an exception occurs. * @@ -640,15 +643,16 @@ * again when the next line has been received. If you want the * next method in the queue to handle the next line, you need to * return false from the method * @param selector The selector to call on the target. The signature must be * `bool (OFStream *stream, OFString *line, - * OFException *exception)`. + * id context, OFException *exception)`. */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding target: (id)target - selector: (SEL)selector; + selector: (SEL)selector + context: (nullable id)context; # ifdef OF_HAVE_BLOCKS /*! * @brief Asynchronously reads until a newline, `\0`, end of stream or an * exception occurs.