@@ -31,11 +31,16 @@ char *cache; @protected char *wBuffer; size_t cacheLen, wBufferLen; BOOL buffersWrites; + BOOL isBlocking; } + +#ifdef OF_HAVE_PROPERTIES +@property (assign, setter=setBlocking) BOOL isBlocking; +#endif /** * Returns a boolean whether the end of the stream has been reached. * * \return A boolean whether the end of the stream has been reached @@ -313,10 +318,25 @@ * \return The number of bytes written */ - (size_t)writeFormat: (OFString*)fmt withArguments: (va_list)args; +/** + * \return Whether the stream is in blocking mode + */ +- (BOOL)isBlocking; + +/** + * Enables or disables non-blocking I/O. + * + * By default, a stream is in blocking mode. + * On Win32, this currently only works for sockets! + * + * \param enable Whether the stream should be blocking + */ +- (void)setBlocking: (BOOL)enable; + /** * \return The file descriptor for the stream. */ - (int)fileDescriptor;