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 application 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 1.4 Game Programming
Java 1.4 Game Programming (Wordware Game and Graphics Library)
ISBN: 1556229631
EAN: 2147483647
Year: 2003
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net