From the course: WebSocket Programming with Java EE

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

WebSocket lifecycle and topology

WebSocket lifecycle and topology

From the course: WebSocket Programming with Java EE

Start my 1-month free trial

WebSocket lifecycle and topology

- [Instructor] WebSocket implementations are deployed in the presentation layer, and are initiated by a client request. The server can never make the first request. What the server does, is to publish the endpoint URI that the client can then connect to, however, once a connection has been made, the flow of data is bidirectional. Both the client and the server can decide to send data to the other. This contrasts with the traditional request response model we are familiar with, where the client requests data from the server and the server complies. In this model, the server does not actually push the data to the client, although there are techniques that have been developed such as long polling, that simulates this type of exchange. So the WebSocket technology opens a bidirectional conversation over a TCP connection between a browser and a server. Every website that connects to the server provokes the creation of a session at the server end. On very busy sites, this can be thousands…

Contents