@@ -48,10 +48,13 @@ return [[[self alloc] init] autorelease]; } - (bool)lowlevelIsAtEndOfStream { + if (_socket == INVALID_SOCKET) + @throw [OFNotOpenException exceptionWithObject: self]; + return _atEndOfStream; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length @@ -59,15 +62,10 @@ ssize_t ret; if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; - if (_atEndOfStream) - @throw [OFReadFailedException exceptionWithObject: self - requestedLength: length - errNo: ENOTCONN]; - #ifndef OF_WINDOWS if ((ret = recv(_socket, buffer, length, 0)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length @@ -93,15 +91,10 @@ length: (size_t)length { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; - if (_atEndOfStream) - @throw [OFWriteFailedException exceptionWithObject: self - requestedLength: length - errNo: ENOTCONN]; - #ifndef OF_WINDOWS if (length > SSIZE_MAX) @throw [OFOutOfRangeException exception]; if (send(_socket, buffer, length, 0) != (ssize_t)length)