<p class="indent">while (true) {<p class="indent"> selector.select();<p class="indent"> for (Iterator<SelectionKey> itor = selector.selectedKeys().iterator(); itor.hasNext();) {<p class="indent"> SelectionKey key = (SelectionKey) itor.next();<p class="indent"> itor.remove();<p class="indent">
<p>[/code <p class="indent"><p class="indent"><p class="indent">不明白为什么要remove,个人感觉每次执行Iterator<SelectionKey> itor = selector.selectedKeys().iterator(),都会回收
|