163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
-
-
+
|
FD_CLR((of_socket_t)fd, &_writeFDs);
[super removeObjectForWriting: object];
}
- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
id const *objects;
fd_set readFDs;
fd_set writeFDs;
struct timeval timeout;
int events;
#ifdef OF_AMIGAOS
ULONG execSignalMask, cancelSignal;
#endif
size_t count;
void *pool;
if ([self of_processReadBuffers])
return;
#ifdef FD_COPY
FD_COPY(&_readFDs, &readFDs);
FD_COPY(&_writeFDs, &writeFDs);
|
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
-
-
+
-
-
-
+
+
+
+
-
+
-
+
-
-
+
+
-
-
-
-
+
+
-
+
-
+
-
+
+
+
|
# else
OF_ENSURE(recvfrom(_cancelFD[0], (void *)&buffer, 1, 0, NULL,
NULL) == 1);
# endif
}
#endif
objects = _readObjects.objects;
count = _readObjects.count;
pool = objc_autoreleasePoolPush();
for (size_t i = 0; i < count; i++) {
void *pool = objc_autoreleasePoolPush();
int fd = [objects[i] fileDescriptorForReading];
for (id <OFReadyForReadingObserving> object in
[[_readObjects copy] autorelease]) {
void *pool2 = objc_autoreleasePoolPush();
int fd = object.fileDescriptorForReading;
if (FD_ISSET((of_socket_t)fd, &readFDs) &&
[_delegate respondsToSelector:
@selector(objectIsReadyForReading:)])
[_delegate objectIsReadyForReading: objects[i]];
[_delegate objectIsReadyForReading: object];
objc_autoreleasePoolPop(pool);
objc_autoreleasePoolPop(pool2);
}
objects = _writeObjects.objects;
count = _writeObjects.count;
for (id <OFReadyForWritingObserving> object in
[[_writeObjects copy] autorelease]) {
for (size_t i = 0; i < count; i++) {
void *pool = objc_autoreleasePoolPush();
int fd = [objects[i] fileDescriptorForWriting];
void *pool2 = objc_autoreleasePoolPush();
int fd = object.fileDescriptorForWriting;
if (FD_ISSET((of_socket_t)fd, &writeFDs) &&
[_delegate respondsToSelector:
@selector(objectIsReadyForWriting:)])
[_delegate objectIsReadyForWriting: objects[i]];
[_delegate objectIsReadyForWriting: object];
objc_autoreleasePoolPop(pool);
objc_autoreleasePoolPop(pool2);
}
}
objc_autoreleasePoolPop(pool);
}
@end
|