Differences From Artifact [9b40b1e63a]:
- File
src/OFStreamObserver_select.m
— part of check-in
[440e95fd4a]
at
2012-09-12 17:27:53
on branch trunk
— Split -[OFStream fileDescriptor].
It is now -[fileDescriptorForReading] and -[fileDescriptorForWriting].
The split was necessary as some stream types (e.g. OFProcess) don't have
a single file descriptor, but two. This allows to use those stream types
with OFStreamObserver as well. (user: js, size: 3391) [annotate] [blame] [check-ins using]
To Artifact [499369cb3d]:
- File src/OFStreamObserver_select.m — part of check-in [c137da5e5b] at 2012-09-16 15:27:48 on branch trunk — Prefix all private methods with OF_. (user: js, size: 3403) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
37 38 39 40 41 42 43 | FD_ZERO(&writeFDs); FD_SET(cancelFD[0], &readFDs); return self; } | | | | | | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | FD_ZERO(&writeFDs); FD_SET(cancelFD[0], &readFDs); return self; } - (void)OF_addFileDescriptorForReading: (int)fd { FD_SET(fd, &readFDs); FD_SET(fd, &exceptFDs); } - (void)OF_addFileDescriptorForWriting: (int)fd { FD_SET(fd, &writeFDs); FD_SET(fd, &exceptFDs); } - (void)OF_removeFileDescriptorForReading: (int)fd { FD_CLR(fd, &readFDs); if (!FD_ISSET(fd, &writeFDs)) FD_CLR(fd, &exceptFDs); } - (void)OF_removeFileDescriptorForWriting: (int)fd { FD_CLR(fd, &writeFDs); if (!FD_ISSET(fd, &readFDs)) FD_CLR(fd, &exceptFDs); } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); OFStream **objects; fd_set readFDs_; fd_set writeFDs_; fd_set exceptFDs_; struct timeval time; size_t i, count, realEvents = 0; [self OF_processQueue]; if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return YES; } objc_autoreleasePoolPop(pool); #ifdef FD_COPY |
︙ | ︙ |