Logo




Subscribe:
RSS 2.0 | Atom 1.0
Categories:

Sign In


[Giagnocavo]Michael::Write()

 Saturday, October 30, 2004
SimpleChat

I wrote this quite some time ago, with the Whidbey Beta, I believe. I was gonna make it nice, but never got around to it, but somehow it came up today and I remembered it. So, I decided to post the code and the link.

Basically, it's an HTML Chat client using a ASP.NET in-process server. It's very, very lightweight -- it wouldn't work for tons of users (it uses a ReaderWriter lock!). I use web services to poll for new messages (or translate received messages, although that seems broken right now).

Now, since it relies on the soap client, it doesn't work on all browers. A easy way around this is to replace the web services with IFRAMEs. Also, if you wanted to scale this solution up (say, you're building a chat client for MSDN :)), I believe you should leave the HTTP connection that receives messages open for say, 60 seconds (or more). This reduces the hit of polling drastically, and works quite well (I tested it in a few browsers). The server only has to authenticate the client ONCE, and then it can just pump new content down the pipe as it seems fit. At any rate, it's a simple chat system that could give someone a head start if they lack a head.

Anyways, get the code (ASP.NET 2 required): SimpleChat.zip (25.33 KB) It's running here: http://www.atrevido.net/SimpleChat/

If there's enough interest, and if a 19th level wizard visits me and gives me a Wand of Time Stop, perhaps I'll write a production level version of this (that DOESN'T use SOAP).

Code
Saturday, October 30, 2004 5:29:29 AM UTC  #    Comments [2]  |  Trackback

Sunday, October 31, 2004 12:19:41 PM UTC
Here is the a "Nth level wizard" to "give you a Wand of Time Stop".

What makes this code "Whidbey Beta"?
Monday, November 01, 2004 6:26:12 AM UTC
Nice example! Actually, this reminded me of a web application UI related article I read not that long ago. Basically they talk about the use of the XML HTTP Request object through JavaScript to refresh the user interface without requiring an entire page refresh. The reason I mention it because it could probably provide a similar effect to what you have now without the dependance of using a SOAP client. It's also supported by a wider range of browsers (IE, Mozilla, Safari, Opera, etc.) It's essentially the way that Gmail and Oddpost (among others) provide such a responsive interface without constantly reloading the entire UI. Here's the link if you're interested:

http://jibbering.com/2002/4/httprequest.html

Best regards,
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview