JaVa
   

Channels

NIO uses what are known as channels instead of the normal streams that the old I/O used. As well as being able to read and write data at the same time, a channel can also be "non-blocking," meaning that your app does not have be dedicated to listening for possible network messages.

By using channels, we can use a continuous loop that polls for any operations to be performed on any of the channels (such as a read or write operation). This is called selection (i.e., we select any channels that require an operation to be performed, and then deal with the selection accordingly).

JaVa
   
Comments