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
165
166
167
168
169
170
171
172
173
174
175
176
|
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);
}
if (realEvents == 0)
return NO;
return YES;
}
@end
|
>
|
|
>
>
>
|
|
>
>
>
>
|
|
>
>
>
|
|
>
>
>
|
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
for (i = 0; i < count; i++) {
int fd = [objects[i] fileDescriptorForReading];
pool = objc_autoreleasePoolPush();
if (FD_ISSET(fd, &readFDs_)) {
if ([delegate respondsToSelector:
@selector(streamIsReadyForReading:)])
[delegate streamIsReadyForReading: objects[i]];
realEvents++;
}
if (FD_ISSET(fd, &exceptFDs_)) {
if ([delegate respondsToSelector:
@selector(streamDidReceiveException:)])
[delegate streamDidReceiveException:
objects[i]];
/*
* Prevent calling it twice in case the FD is in both
* sets.
*/
FD_CLR(fd, &exceptFDs_);
realEvents++;
}
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_)) {
if ([delegate respondsToSelector:
@selector(streamIsReadyForWriting:)])
[delegate streamIsReadyForWriting: objects[i]];
realEvents++;
}
if (FD_ISSET(fd, &exceptFDs_)) {
if ([delegate respondsToSelector:
@selector(streamDidReceiveException:)])
[delegate streamDidReceiveException:
objects[i]];
realEvents++;
}
objc_autoreleasePoolPop(pool);
}
if (realEvents == 0)
return NO;
return YES;
}
@end
|