Connecting to IOCP server in Java (Android)

人走茶凉 提交于 2020-01-06 19:56:49

问题


I'd like to make an Online Game with Android.

I'm planning to make Server with IOCP model via C++. This should work fine, the problem is the client.
IOCP client example in C++ uses WSASyncselect or WSAEventSelect.

I couldn't find any Java examples that same work like async socket.

Questions:

  1. Is there anything like WSASyncselect() in Java?
  2. If not that, how could i do it?

回答1:


The JDK 7 Windows implementation of the Java 7 "NIO.2" classes

  • AsynchronousSocketChannel
  • AsynchronousServerSocketChannel
  • AsynchronousFileChannel

    call the WSA[...] functions of the Windows "Overlapped IO" API behind the scenes.

For more in-depth information check out the OpenJDK repository folders containing the implementation .java sources along with their corresponding .c native sources and JNI bindings .



来源:https://stackoverflow.com/questions/10978765/connecting-to-iocp-server-in-java-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!