Universal Asynchronous I/O API
2.2. Universal Asynchronous I/O API Traditional I/O APIs in Java provided different types and methods for different transport types. For example, java.net.Socket and java.net.DatagramSocket do not have any common super type and therefore they have very different ways to perform socket I/O. This mismatch makes porting a network application from one transport to the other tedious and difficult. The lack of portability between transports becomes a problem when you need to support more transports not rewriting the network layer of the application. Logically, many protocols can run on more than one transport such as TCP/IP, UDP/IP, SCTP, and serial port communication. To make the matter worse, Java New I/O (NIO) API introduced the incompatibility with the old blocking I/O (OIO) API, and so will NIO.2 (AIO). Because all these APIs are different from each other in design and performance characteristics, you are often forced to determine which API your application will depend on before you even begin the implementation phase. For instance, you might want to start with OIO because the number of clients you are going to serve will be very small and writing a socket server using OIO is much easier than using NIO. However, you are going to be in trouble when your business grows up exponentially and your server starts to serve tens of thousand clients simultaneously. You could start with NIO, but it might take much longer time to implement due to the complexity of the NIO Selector API, hindering rapid development. Netty has a universal asynchronous I/O interface called Channel, which abstracts away all operations required to point-to-point communication. That is, once you wrote your application on one Netty transport, your application can run on other Netty transports.