97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
[FDs removeItemAtIndex: i];
break;
}
}
}
- (void)_addStreamToObserveForReading: (OFStream*)stream
{
[self _addStream: stream
withEvents: POLLIN];
}
- (void)_addStreamToObserveForWriting: (OFStream*)stream
{
[self _addStream: stream
withEvents: POLLOUT];
}
- (void)_removeStreamToObserveForReading: (OFStream*)stream
{
[self _removeStream: stream
withEvents: POLLIN];
}
- (void)_removeStreamToObserveForWriting: (OFStream*)stream
{
[self _removeStream: stream
withEvents: POLLOUT];
}
- (BOOL)observeWithTimeout: (int)timeout
{
|
|
|
|
|
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
[FDs removeItemAtIndex: i];
break;
}
}
}
- (void)_addStreamForReading: (OFStream*)stream
{
[self _addStream: stream
withEvents: POLLIN];
}
- (void)_addStreamForWriting: (OFStream*)stream
{
[self _addStream: stream
withEvents: POLLOUT];
}
- (void)_removeStreamForReading: (OFStream*)stream
{
[self _removeStream: stream
withEvents: POLLIN];
}
- (void)_removeStreamForWriting: (OFStream*)stream
{
[self _removeStream: stream
withEvents: POLLOUT];
}
- (BOOL)observeWithTimeout: (int)timeout
{
|
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
assert(read(cancelFD[0], &buffer, 1) > 0);
FDsCArray[i].revents = 0;
continue;
}
[delegate streamDidBecomeReadyForReading:
FDToStream[FDsCArray[i].fd]];
[pool releaseObjects];
}
if (FDsCArray[i].revents & POLLOUT) {
[delegate streamDidBecomeReadyForReading:
FDToStream[FDsCArray[i].fd]];
[pool releaseObjects];
}
if (FDsCArray[i].revents & POLLERR) {
[delegate streamDidReceiveException:
FDToStream[FDsCArray[i].fd]];
|
|
|
|
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
assert(read(cancelFD[0], &buffer, 1) > 0);
FDsCArray[i].revents = 0;
continue;
}
[delegate streamIsReadyForReading:
FDToStream[FDsCArray[i].fd]];
[pool releaseObjects];
}
if (FDsCArray[i].revents & POLLOUT) {
[delegate streamIsReadyForReading:
FDToStream[FDsCArray[i].fd]];
[pool releaseObjects];
}
if (FDsCArray[i].revents & POLLERR) {
[delegate streamDidReceiveException:
FDToStream[FDsCArray[i].fd]];
|