Development of the Web-based chat system using refreshing the page expecting replies from other player, on timer or some other events is really depressive thing. If there are no updates, it's a waste of traffic, if there are, you may get them a bit too late. It's all wrong. Apparently, Web, primarily based on pure
client-server technology (
pull technology) and
stateless protocol, is purely suited for such an apparent task as chat. For some background, please see my past answer:
Application 'dashboard' for website accounts[
^].
But some better resolution of the problem does exist: you need
server push:
http://en.wikipedia.org/wiki/Server_push[
^].
These days, such problems as chat systems are pretty typically solved with such a "push" product as SignalR:
https://en.wikipedia.org/wiki/SignalR[
^],
http://www.asp.net/signalr[
^].
This tutorial shows how to create a SignalR chat application:
http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr[
^].
This CodeProject article can also be useful:
Asp.Net SignalR Chat Room[
^].
—SA