I know the basic concept of a WebSocket . I know that it allows simultaneous bidirectional(Full duplex), persistent communication support built into it . So it is very useful for a server push kind of scenarios . What other scenarios are WebSockets best suited for ? What are some of the common situation where we as programmers should actively look at WebSockets as the solution instead of reinventing the wheel ?
I know the basic concept of a WebSocket . I know that it allows
Share
Well, server push is the main component of the bidirectional support that the single direction of HTTP is lacking. It also supports cross-domain requests. Because the server can now contact the client asynchronously, it enables a whole bunch of techniques and applications:
All of these you could somewhat-do before with long-polling, but it was inefficient (tons of overhead), complex (hard to implement) and ugly (not natural to use at all). WebSocket simpilfies much of that. According to this article, WebSocket can typically reduce overhead by 500 times and latency by 3 times. http://www.websocket.org/quantum.html