John Kilar
John Kilar

Reputation: 65

What is the right method for a web chat application in c#

i'm trying to make a chat application using c# that connects to a web server in order to check if there are messages available.

I've tried that by creating HttpWebRequest to check for messages every second, but i notice that it's not good for the server, imagine if there are thousands of users and each user sends an HttpWebRequest every second, that would be heavy.

I heard something about synchronous connection but i think it also sends the same number of HttpWebRequest, (i'm not sure about this part).

So please does any one know the right method for a chat application?

Upvotes: 0

Views: 2924

Answers (2)

Alex Tsvetkov
Alex Tsvetkov

Reputation: 1659

Perhaps SignalR might be useful in your case.

ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications. What is "real-time web" functionality? It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.

Actually the most typical tutorial using this technology is web chat.

Upvotes: 2

Related Questions