Chapter 14
Completion of Socket Channel Functionality
Completion of socket channel functionality is JDK 7’s final contribution to NIO.2. The java.nio.channels package’s DatagramChannel, ServerSocketChannel, and SocketChannel classes have been extended to support binding and option configuration. Also, channel-based multicasting is supported. This chapter wraps up the book by introducing you to these capabilities.
Binding and Option Configuration
NIO’s DatagramChannel, ServerSocketChannel, and SocketChannel classes don’t completely abstract a network socket. To bind into the channel’s socket, or to get/set socket options, you have to first retrieve the peer socket by invoking each class’s socket() method.
This counterintuitive mix of socket ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access