Reputation: 65
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
Reputation: 661
Use the Remoting.Net see this :
http://www.codeproject.com/Articles/62813/NET-Remoting-Events-Explained http://www.codeproject.com/Articles/12586/Remote-Execution-Using-NET-Remoting
Upvotes: 0
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