There were many attempts to simulate two way communication initiated by the server towards the client. One of the most notable approach is Comet.
Comet uses a technique referred as hanging GET or pending POST. In this the completion of an HTTP response is delayed until the server has something to send. This is generally implemented in JavaScript.
But there are some problems with this approach -
-Resource consumption is high as many connections are opened and closed.
-Setup and teardown of connections will consume more resources if secure connections are used.
HTML 5 may be the answer to these issues.
This provides many enhancements to the browsers and will redefine how internet communicates. The communication section of HTML 5 specification defines WebSockets and ServerSentEvents. These features will enable two way communication a reality for browsers. This will change the way in which real time web applications are created.
The main features are
- Web Sockets : Usually most of what is transmitted in web will be protocol information and padding. Web Sockets establishes a true two-way connection between server and the browser. This is essentially a pure TCP socket through which any application data can flow in either direction. This is more efficient than traditional HTTP requests as the non payload information is not required.
- Server sent Events : Two-way real time communication pattern common in web today is not taken into account in traditional HTTP. Through Sever Sent Events, a server can initiate the transmission of data. This is a standard describing how servers can initiate transmission of data to client once the initial connection with client is established.
- Cross Document Messaging : This provides a system in which different documents are allowed to securely communicate across different origins. This will allow an application to communicate with server over many different channels.
- Cross Origin resource Sharing : This will allow browsers to do site aggregation. Result may be better performance.
No comments:
Post a Comment