West Wind Web Connection AJAX Chat

Messages:

Enter a Message:
Your Chat Handle:
Enter a Chat Id:

Active Users:





This example demonstrates using the wwMethodCallback control with Page method callbacks to implement a small chat application. This page pings the server every few seconds for the latest messages and renders them in the message list. All the code on the server is the form of callback methods - methods that act as a data service to this HTML page. The majority of the code sits on the client side. This code uses the client proxy to make calls to the server and update the controls on the page.

Since AJAX cannot reliably do a PUSH model the only way for the client to get the latest messages is to poll the server for updates frequently. Therefore this is a very chatty interface that fires a lot of requests to the server. Load with many users in this scenario could very easily become a scalability problem. However, this example uses pure JSON messages which push only updated data back and forth so message size generally is very small. You might want to break out Fiddler and compare both the ATLAS and Anthem chat which use different approaches, where this approach is the more bandwidth friendly of the two.