Code example for SelectionKey

Methods: interestOps

0
     * has come in. 
     */ 
    public void changeSelectInterests() { 
      if (state_ == FrameBufferState.AWAITING_REGISTER_WRITE) {
        // set the OP_WRITE interest 
        selectionKey_.interestOps(SelectionKey.OP_WRITE);
        state_ = FrameBufferState.WRITING;
      } else if (state_ == FrameBufferState.AWAITING_REGISTER_READ) {
        prepareRead(); 
      } else if (state_ == FrameBufferState.AWAITING_CLOSE) {
        close(); 
        selectionKey_.cancel();
      } else { 
        Log.e("Thrift", "changeSelectInterest was called, but state is invalid (" + state_ + ")");
      } 
    } 
 
    /** 
     * Shut the connection down. 
     */ 
    public void close() {