使用java nio 时报 java.nio.channels.CancelledKeyException

来源:互联网 发布:与知否一样好看的小说 编辑:程序博客网 时间:2024/06/06 23:46
可以catch这个Exception synchronized(call.connection.responseQueue) {    if (processResponse(call.connection.responseQueue, false)) {      try {        key.interestOps(0);      } catch (CancelledKeyException e) {        /* The Listener/reader might have closed the socket.         * We don't explicitly cancel the key, so not sure if this will         * ever fire.         * This warning could be removed.         */        LOG.warn("Exception while changing ops : " + e);      }    }  }
0 0
原创粉丝点击