Implementing chat in asp.net mvc 4.0 website?
I want to implement chat feature in my asp.net mvc 4.0 website. I've few doubts in my mind.
Should I use MS SQL database to store chat message and to update on user profile using jquery (refreshing after every 5 seconds).
Should I use Inbound Web-hook HTTP Post method to update chat message on user profile using same MS SQL databse.
Should I use XMPP without any database to integrate it in my website and use it.
Please let me know which method is best for implementing chat feature in website?
Let me first clear your doubts.
Using MSSQL server for string and retrieving chat is not a bad option if you are making AJAX call every 5 seconds to see if any new message came from any other users. if any new message arrives just ping the user about the same.
Well Inbound Webhooks automatically send HTTP GET/POST call to the given REST API url, you can refresh the user page whenever you get any inbound webhooks call, so as user will get the new message as soon as it is sent from the other end.
Using XMPP in your chat application will allow you to integrate your chat application with facebook or gtalk like messengers also, so it will add great benefit if you uses XMPP in your application, but for this you need jabber account for every new user.
So, I think after reading all these comments it will be easy for you to decide which feature will be most beneficiary for you in what condition.
I know this doesnt answer any of your question but have you ever looked into working with SignalR?
Sample application here: http://code.msdn.microsoft.com/wpapps/Chat-Web-Application-in-9a86e594
Many tutorials online as well but 2 part example is here
http://visualstudiomagazine.com/articles/2013/01/22/build-a-signal-r-app-part-1.aspx
链接地址: http://www.djcxy.com/p/94114.html上一篇: 聊天应用程序的结构和所需的技术