@@ -102,15 +102,11 @@ * the methods that do the actual work. OFStream uses those for all other * methods and does all the caching and other stuff for you. If you * override these methods without the `lowlevel` prefix, you *will* break * caching and get broken results! */ -@interface OFStream: OFObject < -#ifdef OF_HAVE_SOCKETS - OFReadyForReadingObserving, OFReadyForWritingObserving, -#endif - OFCopying> +@interface OFStream: OFObject { #if !defined(OF_SEEKABLE_STREAM_M) && !defined(OF_TCP_SOCKET_M) @private #endif char *_Nullable _readBuffer, *_Nullable _readBufferMemory; @@ -142,20 +138,10 @@ * By default, a stream is in blocking mode. * On Win32, setting this currently only works for sockets! */ @property (readonly, nonatomic, getter=isBlocking) bool blocking; -/*! - * @brief The file descriptor for the read end of the stream. - */ -@property (readonly, nonatomic) int fileDescriptorForReading; - -/*! - * @brief The file descriptor for the write end of the stream. - */ -@property (readonly, nonatomic) int fileDescriptorForWriting; - /*! * @brief 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 @@ -198,12 +184,12 @@ * If you want to read exactly the specified number of bytes, use * @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 atEndOfStream. * - * @note The stream must implement @ref fileDescriptorForReading and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param buffer The buffer into which the data is read. * The buffer must not be freed before the async read completed! * @param length The length of the data that should be read at most. * The buffer *must* be *at least* this big! @@ -231,12 +217,12 @@ * 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! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param buffer The buffer into which the data is read * @param length The length of the data that should be read. * The buffer *must* be *at least* this big! * @param target The target on which the selector should be called when the @@ -265,12 +251,12 @@ * 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 atEndOfStream. * - * @note The stream must implement @ref fileDescriptorForReading and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param buffer The buffer into which the data is read. * The buffer must not be freed before the async read completed! * @param length The length of the data that should be read at most. * The buffer *must* be *at least* this big! @@ -291,12 +277,12 @@ * Unlike @ref asyncReadIntoBuffer:length:block:, this method does not invoke * the block 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! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param buffer The buffer into which the data is read * @param length The length of the data that should be read. * The buffer *must* be *at least* this big! * @param block The block to call when the data has been received. @@ -660,12 +646,12 @@ #ifdef OF_HAVE_SOCKETS /*! * @brief Asynchronously reads until a newline, `\0`, end of stream or an * exception occurs. * - * @note The stream must implement @ref fileDescriptorForReading and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param target The target on which to call the selector when the data has * 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 @@ -681,12 +667,12 @@ /*! * @brief Asynchronously reads with the specified encoding until a newline, * `\0`, end of stream or an exception occurs. * - * @note The stream must implement @ref fileDescriptorForReading and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param encoding The encoding used by the stream * @param target The target on which to call the selector when the data has * been received. If the method returns true, it will be called * again when the next line has been received. If you want the @@ -705,12 +691,12 @@ # ifdef OF_HAVE_BLOCKS /*! * @brief Asynchronously reads until a newline, `\0`, end of stream or an * exception occurs. * - * @note The stream must implement @ref fileDescriptorForReading and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param block The block to call when the data has been received. * If the block returns true, it will be called again when the next * line has been received. If you want the next block in the queue * to handle the next line, you need to return false from the @@ -720,12 +706,12 @@ /*! * @brief Asynchronously reads with the specified encoding until a newline, * `\0`, end of stream or an exception occurs. * - * @note The stream must implement @ref fileDescriptorForReading and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForReadingObserving in order + * for this to work! * * @param encoding The encoding used by the stream * @param block The block to call when the data has been received. * If the block returns true, it will be called again when the next * line has been received. If you want the next block in the queue @@ -821,12 +807,12 @@ #ifdef OF_HAVE_SOCKETS /*! * @brief Asynchronously writes a buffer into the stream. * - * @note The stream must implement @ref fileDescriptorForWriting and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForWritingObserving in order + * for this to work! * * @param buffer The buffer from which the data is written into the stream. The * buffer needs to be valid until the write request is completed! * @param length The length of the data that should be written * @param target The target on which the selector should be called when the @@ -848,12 +834,12 @@ # ifdef OF_HAVE_BLOCKS /*! * @brief Asynchronously writes a buffer into the stream. * - * @note The stream must implement @ref fileDescriptorForWriting and return a - * valid file descriptor in order for this to work! + * @note The stream must conform to @ref OFReadyForWritingObserving in order + * for this to work! * * @param buffer The buffer from which the data is written into the stream. The * buffer needs to be valid until the write request is completed! * @param length The length of the data that should be written * @param block The block to call when the data has been written. It should