The document discusses how WebSocket provides full-duplex and bi-directional communication over a single TCP connection, addressing limitations of HTTP such as being half-duplex and requiring a new connection per request. It explains how WebSocket works by upgrading the initial HTTP connection to a WebSocket connection through a handshake process. It also describes how the Java API supports WebSocket through annotations and callback methods to handle messages, connections and errors for server and client endpoints.