JaVa
   

Why Use NIO?

The main advantage of using NIO over standard I/O streams is the fact that we can now create a non-blocking server, meaning that the server does not have to sit and wait to read a message from a stream. This also means that with TCP, we no longer require a separate thread for each individual client that connects to the server.

As you can guess, the main advantage from a games point of view is massively multiplayer games, where there can be hundreds or even thousands of connections at one time. This would be costly if we had to create several thousand individual threads to handle each of the players!

JaVa
   
Comments