@@ -86,10 +86,11 @@ fd_set readfds; fd_set writefds; fd_set exceptfds; int nfds; #endif + int cancelFd[2]; } #ifdef OF_HAVE_PROPERTIES @property (retain) id delegate; #endif @@ -111,15 +112,18 @@ */ - (void)setDelegate: (id )delegate; /** * Adds a stream to observe for reading. - * + * * This is also used to observe a listening socket for incoming connections, * which then triggers a read event for the observed stream. * * It is recommended that the stream you add is set to non-blocking mode. + * + * If there is an -[observe] call blocking, it will be canceled. The reason for + * this is to prevent blocking even though the new added stream is ready. * * \param stream The stream to observe for reading */ - (void)addStreamToObserveForReading: (OFStream*)stream; @@ -126,23 +130,32 @@ /** * Adds a stream to observe for writing. * * It is recommended that the stream you add is set to non-blocking mode. * + * If there is an -[observe] call blocking, it will be canceled. The reason for + * this is to prevent blocking even though the new added stream is ready. + * * \param stream The stream to observe for writing */ - (void)addStreamToObserveForWriting: (OFStream*)stream; /** * Removes a stream to observe for reading. * + * If there is an -[observe] call blocking, it will be canceled. The reason for + * this is to prevent the removed stream from still being observed. + * * \param stream The stream to remove from observing for reading */ - (void)removeStreamToObserveForReading: (OFStream*)stream; /** * Removes a stream to observe for writing. + * + * If there is an -[observe] call blocking, it will be canceled. The reason for + * this is to prevent the removed stream from still being observed. * * \param stream The stream to remove from observing for writing */ - (void)removeStreamToObserveForWriting: (OFStream*)stream;