@@ -61,13 +61,12 @@ return self; } - (void)OF_addObjectForReading: (id)object + fileDescriptor: (int)fd { - int fd = [object fileDescriptorForReading]; - if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; #ifndef _WIN32 if (fd >= FD_SETSIZE) @@ -79,13 +78,12 @@ FD_SET(fd, &_readFDs); } - (void)OF_addObjectForWriting: (id)object + fileDescriptor: (int)fd { - int fd = [object fileDescriptorForWriting]; - if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; #ifndef _WIN32 if (fd >= FD_SETSIZE) @@ -97,15 +95,14 @@ FD_SET(fd, &_writeFDs); } - (void)OF_removeObjectForReading: (id)object + fileDescriptor: (int)fd { /* TODO: Adjust _maxFD */ - int fd = [object fileDescriptorForReading]; - if (fd < 0) @throw [OFOutOfRangeException exception]; #ifndef _WIN32 if (fd >= FD_SETSIZE) @@ -114,15 +111,14 @@ FD_CLR(fd, &_readFDs); } - (void)OF_removeObjectForWriting: (id)object + fileDescriptor: (int)fd { /* TODO: Adjust _maxFD */ - int fd = [object fileDescriptorForWriting]; - if (fd < 0) @throw [OFOutOfRangeException exception]; #ifndef _WIN32 if (fd >= FD_SETSIZE) @@ -140,11 +136,11 @@ fd_set writeFDs; struct timeval timeout; int events; size_t i, count; - [self OF_processQueueAndStoreRemovedIn: nil]; + [self OF_processQueue]; [self OF_processReadBuffers]; objc_autoreleasePoolPop(pool); #ifdef FD_COPY