Java Platform, Enterprise Edition (Java EE) 8 The Java EE Tutorial

## 19 Java API for WebSocket

This chapter describes the Java API for WebSocket (JSR 356), which provides support for creating WebSocket applications. WebSocket is an application protocol that provides full-duplex communications between two peers over the TCP protocol.

The following topics are addressed here:

- Introduction to WebSocket

- Creating WebSocket Applications in the Java EE Platform

- Programmatic Endpoints

- Annotated Endpoints

- Sending and Receiving Messages

- Maintaining Client State

- Using Encoders and Decoders

- Path Parameters

- Handling Errors

- Specifying an Endpoint Configurator Class

- The dukeetf2 Example Application

- The websocketbot Example Application

- Further Information about WebSocket

Copyright © 2017, Oracle and/or its affiliates. All rights reserved.