本文介绍了ASP.NET聊天与WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在找落实ASP.NET页面聊天室界面。我在学习WCF的过程中,似乎是适当的一个聊天应用程序。以前我太参与到WCF我想,以确保它是使发展中国家在ASP.NET一个聊天应用程序的正确选择。任何人都可以提供任何反馈意见?

I'm looking to implement a chatroom interface for an ASP.NET page. I'm in the process of learning WCF and it seems that it is appropriate for a chat application. Before I get too involved into WCF I want to be sure it is the right choice to make for developing a chat application in ASP.NET. Can anyone provide any feedback?

我发现,主要使用Silverlight与WCF聊天应用的一些示例应用程序。是否有任何限制,如果我选择不使用Silverlight?

I found a few example applications that primarily use Silverlight with WCF for chat applications. Are there any limitations if I choose not to use Silverlight?

此外,任何替代WCF,我会在有完全控制权将是非常有益的。我知道我可以使用AJAX投票,对优势反馈/弱势都AP preciated。谢谢你。

Also, any alternatives to WCF that I would have full control over would be very helpful. I'm aware I can use AJAX polling, feedback on advantages/disadvantaged are all appreciated. Thank you.

推荐答案

您可以使用本机ASP.Net方法或Silverlight方法来开发好看的聊天应用程序。

You can use either Native ASP.Net approach or Silverlight approach to develop the good looking chat application.

唯一要担心的是你的应用程序如何响应最终用户。这里的响应表示系统如何让用户感到其他用户实时聊天体验的presense。这是refrenced有时为真正的实时。 (如Gmail和放大器; Facebook的网上聊天使用户可以看到用户presense说:用户在打字或闲置)

The only concern is how your application is responsive to the end user. Here responsive means how the system let the user to feel the presense of other users and real time chat experience. This is refrenced sometime as really real time. (Like gmail & facebook webchat allows the user to see the user presense saying "user is typing or idle")

您可以使用achive这两种技术的实时外观这个水平。但实现是有点不同。

You can achive this level of realtime appearance using both these technologies. But implementation are little different.

为了才达到这一点,你必须实现浏览器和服务器之间的全双工通信。所以,这时如果有来自其他用户或他的presense任何回应服务器将通知客户。

In order to achive this, you must implement a duplex communication between the browser and server. So then server will notify the client if there is any response from other user or his presense.

在ASP.Net方式:


  • 这是完全被控制
    AJAX。

  • 您必须模拟使用AJAX的全双工通信。 默认情况下HTTP犯规支持双面。其单向。它只是客户端请求的响应。它不能直接调用客户端的方法。

  • 有可用才达到这个现有技术。其中一个方法被称为 COMET ReverseAJAX

  • 它只不过是长期生活AJAX调用,如果有一个预期的事件在服务器端发生在客户端会作出回应,否则它保持平静。这 Wikipedia文章详细解释了这种方法。

  • This is been completely controlled byAJAX.
  • You have to simulate the Duplex communication using AJAX. By default HTTP doesnt support duplex. Its oneway. It only responses to client request. It cant directly invoke client method .
  • There are existing techniques available to achive this. One of the approach is called COMET or ReverseAJAX.
  • Its nothing but the long living AJAX calls, and will respond to the client if there is a expected event happening in server side, otherwise it stays calm. This Comet (programming) wikipedia article explains more about the approach.

在Silverlight方式:


  • 的Silverlight相比普通HTML网页提供更好的用户体验。

  • 将使用SL,您可以利用实现服务器推送技术。根据MSDN,它说

  • Silverlight gives much better User experience compared to normal HTML pages.
  • By using SL, you can make use of WCF Duplex services to implement the server push technique. As per MSDN, it says

一个双工服务合同是一个消息
  交换模式,其中两个
  端点可以发送邮件到
  相互独立。双工服务,
  因此,可以将消息发送回
  客户端端点,提供
  事件样行为


  • 在这里,很好的例子在SL实施双工。

  • Here the nice example implementing duplex in SL.
  • 希望这有助于

    这篇关于ASP.NET聊天与WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 04:30