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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.