Monday, December 3, 2012

Web Sockets

According to w3c web socket is, "An API that enables Web pages to use the Web Sockets protocol for two-way communication with a remote host".

HTTP is a request reply protocol.When client loads a page, it'll only load the page. But using Ajax, we could do the periodic polling. That means, according to the user events, page will load new data from the server. But still the HTTP request is started by the client.

Long polling is a technology that enable the server to send data to the client. The client send an HTTP request, server holds that request until there is data to return. Client sends a new request as soon as the previous request completes.

But there are issues with these technologies like, High latency(Periodic polling), Unintuitive (Long polling), Bandwidth overheads and scale out issues.

Using Web Sockets we can create a TCP socket connection between client and the server. That means, a persistent connection between client and the server and any party can send data to other party at any time.

Advantages

  • New inter-operable technology, undergoing standardization
  • Full duplex bidirectional connection
  • W3C java-script API
  • Secure connection
  • High performance (Low latency, Low bandwidth overhead)
  • Cross - domain connection

No comments:

Post a Comment