ChromeSocketsTcpServer.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:cordova-plugin-chrome-apps-sockets-tcpServer 作者:
private void setPaused(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {
  int socketId = args.getInt(0);
  boolean paused = args.getBoolean(1);

  TcpServerSocket socket = sockets.get(Integer.valueOf(socketId));

  if (socket == null) {
    Log.e(LOG_TAG, "No socket with socketId " + socketId);
    return;
  }

  socket.setPaused(paused);

  if (paused) {
    // Accept interest will be removed when socket is acceptable on selector thread.
    callbackContext.success();
  } else {
    // All interests need to be modified in selector thread.
    addSelectorMessage(socket, SelectorMessageType.SO_ADD_ACCEPT_INTEREST, callbackContext);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号