问题
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:
- Is there anything like
WSASyncselect()
in Java? - 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