示例#1
0
文件: Overlord.java 项目: rf/bitster
  /** Registers a SelectableChannel */
  public boolean register(SelectableChannel sc, Communicator communicator) {
    try {
      sc.register(selector, sc.validOps(), communicator);

      return true;
    } catch (Exception e) {
      return false;
    }
  }
示例#2
0
 public void register(SelectableChannel ch, int ops, Handler h) throws IOException {
   ch.register(sel, ops, h);
 }
示例#3
0
 public void register(SelectableChannel ch, int ops, Handler h) throws IOException {
   synchronized (gate) {
     sel.wakeup();
     ch.register(sel, ops, h);
   }
 }