260. Introducing the Java Socket API
Java Socket API support in Java has constantly evolved from JDK 1.0 to JDK 7. Starting with JDK 7 and NIO.2, sockets support has been seriously improved with a new API (new classes and interfaces) for easily writing complex TCP/UDP-based applications. For instance, the NetworkChannel interface was introduced as a common implementation point for all network channel classes. Any class that implements NetworkChannel has access to common methods useful for handling channels to network sockets. Such classes are SocketChannel, ServerSocketChannel, and DatagramChannel. These classes take advantage of methods for handling local addresses and for configuring socket options via SocketOption<T> (interface) and StandardSocketOptions (class). Moreover, this API exposes methods for accessing remote addresses, checking connection status, and shutting down sockets.
One of the most important subinterfaces of NetworkChannel is MulticastChannel. This interface...