Mercurial Hosting > luan
comparison src/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java @ 956:1094975d013b
remove setCheckForIdle()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 13 Oct 2016 18:11:01 -0600 |
parents | 6f49b8dfffe6 |
children | 7b94f5b33c64 |
comparison
equal
deleted
inserted
replaced
955:6f49b8dfffe6 | 956:1094975d013b |
---|---|
78 /** True if a thread has is blocked in {@link #blockWritable(long)} */ | 78 /** True if a thread has is blocked in {@link #blockWritable(long)} */ |
79 private boolean _writeBlocked; | 79 private boolean _writeBlocked; |
80 | 80 |
81 /** true if {@link SelectSet#destroyEndPoint(SelectChannelEndPoint)} has not been called */ | 81 /** true if {@link SelectSet#destroyEndPoint(SelectChannelEndPoint)} has not been called */ |
82 private boolean _open; | 82 private boolean _open; |
83 | |
84 private volatile boolean _checkIdle; | |
85 | 83 |
86 private boolean _ishut; | 84 private boolean _ishut; |
87 | 85 |
88 public SelectChannelEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key, int maxIdleTime) | 86 public SelectChannelEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key, int maxIdleTime) |
89 throws IOException | 87 throws IOException |
93 _manager = selectSet.getManager(); | 91 _manager = selectSet.getManager(); |
94 _selectSet = selectSet; | 92 _selectSet = selectSet; |
95 _state = STATE_UNDISPATCHED; | 93 _state = STATE_UNDISPATCHED; |
96 _open = true; | 94 _open = true; |
97 _key = key; | 95 _key = key; |
98 | |
99 setCheckForIdle(true); | |
100 } | 96 } |
101 | 97 |
102 @Override | 98 @Override |
103 public Connection getConnection() | 99 public Connection getConnection() |
104 { | 100 { |
192 _state = STATE_UNDISPATCHED; | 188 _state = STATE_UNDISPATCHED; |
193 updateKey(); | 189 updateKey(); |
194 } | 190 } |
195 | 191 |
196 @Override | 192 @Override |
197 public void setCheckForIdle(boolean check) | |
198 { | |
199 if (check) | |
200 { | |
201 _checkIdle = true; | |
202 } | |
203 else | |
204 _checkIdle = false; | |
205 } | |
206 | |
207 @Override | |
208 public int fill(Buffer buffer) throws IOException | 193 public int fill(Buffer buffer) throws IOException |
209 { | 194 { |
210 int fill=super.fill(buffer); | 195 int fill=super.fill(buffer); |
211 return fill; | 196 return fill; |
212 } | 197 } |
268 if (isInputShutdown()) | 253 if (isInputShutdown()) |
269 throw new EofException(); | 254 throw new EofException(); |
270 | 255 |
271 long now = _selectSet.getNow(); | 256 long now = _selectSet.getNow(); |
272 long end = now+timeoutMs; | 257 long end = now+timeoutMs; |
273 boolean check = _checkIdle; | |
274 setCheckForIdle(true); | |
275 try | 258 try |
276 { | 259 { |
277 _readBlocked = true; | 260 _readBlocked = true; |
278 while (!isInputShutdown() && _readBlocked) | 261 while (!isInputShutdown() && _readBlocked) |
279 { | 262 { |
296 } | 279 } |
297 } | 280 } |
298 finally | 281 finally |
299 { | 282 { |
300 _readBlocked = false; | 283 _readBlocked = false; |
301 setCheckForIdle(check); | |
302 } | 284 } |
303 } | 285 } |
304 return true; | 286 return true; |
305 } | 287 } |
306 | 288 |
316 if (isOutputShutdown()) | 298 if (isOutputShutdown()) |
317 throw new EofException(); | 299 throw new EofException(); |
318 | 300 |
319 long now=_selectSet.getNow(); | 301 long now=_selectSet.getNow(); |
320 long end=now+timeoutMs; | 302 long end=now+timeoutMs; |
321 boolean check = _checkIdle; | |
322 setCheckForIdle(true); | |
323 try | 303 try |
324 { | 304 { |
325 _writeBlocked = true; | 305 _writeBlocked = true; |
326 while (_writeBlocked && !isOutputShutdown()) | 306 while (_writeBlocked && !isOutputShutdown()) |
327 { | 307 { |
343 } | 323 } |
344 } | 324 } |
345 finally | 325 finally |
346 { | 326 { |
347 _writeBlocked = false; | 327 _writeBlocked = false; |
348 setCheckForIdle(check); | |
349 } | 328 } |
350 } | 329 } |
351 return true; | 330 return true; |
352 } | 331 } |
353 | 332 |