WebSockets and Web Pages Two Way Communication

Suppose that you have to design a web application (i.e. stock exchange) which should be designed in the way that the client should be updated instantly with any change submitted by other clients, and also you have to implement this design using ASP.NET (or other web apps technologies).
As you know that HTTP protocol is stateless protocol based on request/response using non-permanent connection with server which is not longer than your request/response time, there is no problem to implement this type of applications using windows forms and WCF full duplex, but the challenge here is to implement it using web pages technology.

So what is the scenario that you can use to implement this design using ASP.NET Pages?
- Periodical checking the server side for any updates from other clients (also the same will be done by other clients) which will lead into hitting server performance with direct proportion with transactions number, also this is not corresponding with real time apps like stock exchange due to the delay of periodical checking and other issues, So this scenario is not practical scenario for this type of apps.
- The above scenario will leading you to think about something that let server side updating the subscribed clients with any change between each other, but again the nature of HTTP protocol will not help you to do that whilst the request direction always from client to server, some developers resolved this issue with some tricky way by letting the connection opened between server and client, and to do that your server side should be in continuous response until you ending your session with server. This scenario will resolve our issue concerned with HTTP protocol; but still complex to be implemented and hard to maintain.
- Another scenario is to use the new invented technique “WebSockets” standardized by W3C and supported mainly by latest version of browsers like chrome and fire fox, also there is a Lab by Microsoft(part of HTML 5 Labs) to be supported in IE, WebSockets is a technique for two-way communication over one (TCP) socket, using WebSockets is the best scenario to implement Stock Change app based on web technology and also it will be the future of this type of apps, this solution will save a lot of time and work around to introduce real-time apps through web browsers.

What is WebSockets? WebSockets is a technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket, it is designed to be implemented in web browsers and web servers, The WebSocket API is being standardized by the W3C, and the WebSocket protocol is being standardized by the IETF

Good WebSockets links
http://en.wikipedia.org/wiki/WebSockets
http://dev.w3.org/html5/websockets/
http://html5labs.interoperabilitybridges.com/prototypes/websockets/websockets/info
Published Sunday, May 22, 2011 5:58 PM by Hisham El-bereky
Filed under: , , ,

Comments

# re: WebSockets and Web Pages Two Way Communication

Sunday, May 22, 2011 6:35 PM by Justin Soliz

I would recommend throwing a couple <p> tags here and there for readability.

# re: WebSockets and Web Pages Two Way Communication

Monday, May 23, 2011 4:10 AM by Hisham El-bereky

thanks Justin, i'll update the content for readability.

# re: WebSockets and Web Pages Two Way Communication

Friday, June 10, 2011 10:29 AM by Hisham El-bereky

you can find some demos about using websocket here html5labs.interoperabilitybridges.com/.../info

also you can find a link in the page for downloading demos source.

# re: WebSockets and Web Pages Two Way Communication

Wednesday, April 3, 2013 2:46 PM by PzqPXuIqnMrvdgp

nRTUBj Really enjoyed this post.Thanks Again. Much obliged.

# re: WebSockets and Web Pages Two Way Communication

Saturday, May 25, 2013 7:29 PM by KrmZsqgxEOBfDgYN

jgQDwO I loved your article.Thanks Again. Keep writing.

# re: WebSockets and Web Pages Two Way Communication

Tuesday, September 24, 2013 3:22 PM by PPJbmkhwHk

aabwlz I am so grateful for your article. Fantastic.

# re: WebSockets and Web Pages Two Way Communication

Tuesday, October 15, 2013 3:44 PM by jCLVkxziiBYlzKpjw

MRTFi6 I think this is a real great blog post.Really thank you! Really Great.

# re: WebSockets and Web Pages Two Way Communication

Monday, November 18, 2013 2:37 PM by mOjoMzDVaQ

wnupre Thanks again for the article. Cool.

# re: WebSockets and Web Pages Two Way Communication

Sunday, December 15, 2013 8:47 AM by opcdIjwYIRLROWWe

Ezooix Major thanks for the blog. Keep writing.

# re: WebSockets and Web Pages Two Way Communication

Wednesday, January 8, 2014 9:47 AM by coZQIhVdVWD

gi7On0 Appreciate you sharing, great blog.Really thank you! Will read on...

# re: WebSockets and Web Pages Two Way Communication

Friday, February 28, 2014 2:51 PM by axBZdRFFZrjfwFqMLZ

GiQXoI Really informative article post.Thanks Again. Cool.

# re: WebSockets and Web Pages Two Way Communication

Tuesday, April 1, 2014 5:56 AM by GfztsYXFSdyiCNtX

9BTvMI Thanks a lot for the article.Thanks Again. Much obliged.

Leave a Comment

(required) 
(required) 
(optional)
(required)