image
CHAPTER
4
WebSocket
HTTP was designed to share information over the Internet, and it has served very well in that respect. But it is inherently half-duplex; that is, the client (in most cases the browser) initiates a request to an HTTP server, and the server processes the request and responds to the client. Web applications that require the server to push information to the client have typically achieved that functionality by abusing the protocol, such as via polling and long polling.
In polling, a client requests a resource from a server using normal HTTP at regular intervals. A new connection to the server is opened at the specified interval, ...

Get Java EE and HTML5 Enterprise Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.