SocketChannel
SocketChannel is a component of Java's NIO (New I/O) framework that represents a selectable channel for stream-oriented connecting sockets, typically TCP. It can operate in blocking or non-blocking mode and is designed to be used with a Selector to handle many connections efficiently. The channel provides read and write operations that transfer data to and from ByteBuffer instances, and it supports registration with a Selector for events such as connect, read, and write.
A SocketChannel is opened by calling its static open method and then connected to a remote address
Data transfer uses ByteBuffer objects. Reads may return fewer bytes than requested, and writes may not transfer
A ServerSocketChannel complements SocketChannel: it listens for incoming connections and, upon acceptance, creates a new SocketChannel
Closing the channel terminates the connection and releases system resources. SocketChannel is part of the java.nio.channels