在ASP.NET聊天应用ASP、NET

2023-09-10 18:01:38 作者:资深狗友i

我已经写了一个朋友在ASP.NET一个Ajax聊天的Web应用程序,我有一个问题:如果客户端1将消息发送到客户机程序,应该如何应用程序将消息发送给客户机2?难道还有比发送请求到服务器,问是否有新邮件更好的办法?是否有可能直接将消息发送到客户端?

I've to write an Ajax chat web application in ASP.NET for a friend, and I've a question: if client1 sends a message to client2, how should the application send the message to client2? Is there a better way than sending requests to the server, "asking" if there are new messages? Is it possible to directly send the message to the client?

推荐答案

你可以做的最好的事情就是使用的持久性HTTP连接。的方式谷歌没有与谷歌谈自己的 GMAIL 的网站。

Best thing you can do is use a Persistent HTTP Connection. The way google does with Google Talk on their GMAIL website.

 
精彩推荐
图片推荐