Differences From Artifact [eb397d13f9]:
- File
src/OFStreamObserver_select.m
— part of check-in
[3de549d6a5]
at
2012-09-12 06:00:29
on branch trunk
— OFStreamObserver: Cancel is no event anymore.
As cancel internally was an event, -[observeWithTimeout:] returned YES
before when an observe call was canceled. Now, the number of real events
is counted and NO returned if this is 0. (user: js, size: 3455) [annotate] [blame] [check-ins using]
To 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]
︙ | ︙ | |||
114 115 116 117 118 119 120 | #endif } objects = [readStreams objects]; count = [readStreams count]; for (i = 0; i < count; i++) { | | | | | | | | | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | #endif } objects = [readStreams objects]; count = [readStreams count]; for (i = 0; i < count; i++) { int fd = [objects[i] fileDescriptorForReading]; pool = objc_autoreleasePoolPush(); if (FD_ISSET(fd, &readFDs_)) { realEvents++; [delegate streamIsReadyForReading: objects[i]]; } if (FD_ISSET(fd, &exceptFDs_)) { realEvents++; [delegate streamDidReceiveException: objects[i]]; /* * Prevent calling it twice in case the FD is in both * sets. */ FD_CLR(fd, &exceptFDs_); } objc_autoreleasePoolPop(pool); } objects = [writeStreams objects]; count = [writeStreams count]; for (i = 0; i < count; i++) { int fd = [objects[i] fileDescriptorForWriting]; pool = objc_autoreleasePoolPush(); if (FD_ISSET(fd, &writeFDs_)) { realEvents++; [delegate streamIsReadyForWriting: objects[i]]; } if (FD_ISSET(fd, &exceptFDs_)) { realEvents++; [delegate streamDidReceiveException: objects[i]]; } objc_autoreleasePoolPop(pool); } |
︙ | ︙ |