Code example for Selector

Methods: close

0
      LinkedList<SelectorInfo> queue; 
       
      void close() { 
        if (selector != null) {
          try { 
            selector.close();
          } catch (IOException e) {
            LOG.warn("Unexpected exception while closing selector : " +
                     StringUtils.stringifyException(e));
          } 
        } 
      }     
    } 
     
    private static class ProviderInfo { 
      SelectorProvider provider;
      LinkedList<SelectorInfo> queue; // lifo
      ProviderInfo next;
    } 
     
    private static final long IDLE_TIMEOUT = 10 * 1000; // 10 seconds.