O'Reilly logo

Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON by Bhakti Mehta, Masoud Kalali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Understanding WebSockets and Server-sent Events in Detail

WebSocket is one of the most promising features that HTML5 has to offer. As covered in Chapter 2, WebSockets and Server-sent Events, the traditional request-response model incurred an overhead due to the HTTP headers. With WebSockets, once the initial handshake is done the client and server or peers can communicate directly without the use of headers. This reduces the network latency and gives a reduction in HTTP header traffic.

Chapter 2, WebSockets and Server-sent Events, also introduced Server-sent Events and provides a comparison between SSE and WebSockets.

Server-sent Events define an API where the server communicates and pushes events to the clients as they occur. It is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required