This is a reposted summary post that helps you learn non-blocking network communication methods.
To improve the network communication performance of Android, you can use the high-performance NiO (New I/O) technology on Java for processing. Nio mainly uses channel and selector for implementation, java selector is similar to the select mode of WinSock and is event-driven. The entire processing method uses the rotation state machine to improve the thread usage efficiency.
Reference:
NIO non-blocking package for Android development (1)
NIO non-blocking package for Android Development (2)
NIO non-blocking package for Android Development (III)
NIO non-blocking package for Android development (4)
NIO non-blocking package for Android development (5)
NIO non-blocking package for Android Development (6)
NIO non-blocking package for Android Development (7)
NIO non-blocking package for Android development (8)
The article is very clear. Here is a record. You can refer to it later.