如何用.NET进行全双工编程?

时间:2022-08-26 19:53:45

After seeing the Google Wave demos, I thought of incorporating "real-time" capabilities into my web application, where one user will be able to see text another user is typing in as it happens...

在看过Google Wave演示之后,我想到将“实时”功能整合到我的Web应用程序中,其中一个用户将能够看到另一个用户正在键入的文本...

Besides the soft real-time capabilities built into .NET based on how the framework handles threads...

除了基于框架如何处理线程的.NET内置的软实时功能......

Is there anything else I would need? Is there any pattern or architectural reference for real-time web apps out there? Something I should read?

还有什么我需要的吗?那里有实时网络应用程序的模式或架构参考吗?我应该读些什么?

Thanks!

7 个解决方案

#1


Check out WebSync. It's a .NET comet server that should do exactly what you need.

查看WebSync。它是一个.NET彗星服务器,应该完全符合您的需求。

#2


You could try to use a full duplex channel with Silverlight. Similar to the Java applet idea except in .Net.

您可以尝试使用Silverlight的全双工通道。类似于Java applet的想法,除了.Net。

WCF + Silverlight

WCF + Silverlight

#3


Short of using a Java applet or similar, your HTML/JavaScript front-end will need to poll the server for relevant events and changes.

如果不使用Java小程序或类似程序,您的HTML / JavaScript前端将需要轮询服务器以查找相关事件和更改。

On the backend, there are a multitude of ways to implement a distributed event queue or similar to share between individual processes serving requests.

在后端,有多种方法可以实现分布式事件队列或类似方法在服务请求的各个进程之间共享。

#4


Ajax,SUP and XMPP will help you in this regard. Also study how Twitter Search and Friendfeed works.

Ajax,SUP和XMPP将在这方面为您提供帮助。还要研究Twitter Search和Friendfeed的工作原理。

#5


Comet, although not always appropriate, in a sense it is "polling", although it only polls once at the beginning of a potentially long'ish job; the server then keeps the HTTP connection open until it is ready to respond.

彗星,虽然并不总是合适,但在某种意义上说它是“民意调查”,尽管它只是在一个潜在的长期工作开始时才进行一次民意调查;然后,服务器保持HTTP连接打开,直到它准备好响应。

As defined by Wikipedia: "In web development, Comet is a neologism to describe a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it."

正如*所定义的那样:“在网络开发中,Comet是一个描述Web应用程序模型的新词,其中长期持有的HTTP请求允许Web服务器将数据推送到浏览器,而浏览器没有明确请求它。”

Found this to be useful for a job that may take the server five minutes to finish, instead of polling every x seconds, the client makes the request and the server essentially says "hang on..." and does it the work and returns the data when completed.

发现这对于可能需要服务器完成五分钟的工作非常有用,而不是每隔x秒轮询一次,客户端发出请求并且服务器基本上说“挂起......”然后执行工作并返回数据完成后。

There are several libraries that support this type of Ajax implementation including Dojo (dojo.com) and ExtJS 3.0 (extjs.com).

有几个库支持这种类型的Ajax实现,包括Dojo(dojo.com)和ExtJS 3.0(extjs.com)。

#6


We have developed a operational transformation engine, the technology backend that powers Google Wave, and did simultaneous drawing and text editing demos available using DuplexChannel on Silverlight. You can download it from http://www.corvalius.com/blog/index.php/technology/announcing-the-availability-of-the-beweevee-sdk-september-ctp/ .

我们开发了一个操作转换引擎,为Google Wave提供支持的技术后端,并使用Silverlight上的DuplexChannel进行同步绘图和文本编辑演示。您可以从http://www.corvalius.com/blog/index.php/technology/announcing-the-availability-of-the-beweevee-sdk-september-ctp/下载。

We plan to release the SDK (that it is in preview right now) completely free for non-commercial/academic purposes; so it may be of your interest to take a look. At least you will be able to find a very simple example of how to do full duplex for collaborative apps in source (small WCF server included).

我们计划完全免费发布SDK(现在正在预览中)用于非商业/学术目的;所以看看你可能是有兴趣的。至少您将能够找到一个非常简单的示例,说明如何在源中为协作应用程序执行全双工(包括小型WCF服务器)。

#7


Since its a Web app, I'd suggest you to try etherpad!

由于它是一个Web应用程序,我建议你尝试使用etherpad!

There is a .NET Client example on HTTP API and a page on other examples

HTTP API上有一个.NET Client示例,其他示例上有一个页面

#1


Check out WebSync. It's a .NET comet server that should do exactly what you need.

查看WebSync。它是一个.NET彗星服务器,应该完全符合您的需求。

#2


You could try to use a full duplex channel with Silverlight. Similar to the Java applet idea except in .Net.

您可以尝试使用Silverlight的全双工通道。类似于Java applet的想法,除了.Net。

WCF + Silverlight

WCF + Silverlight

#3


Short of using a Java applet or similar, your HTML/JavaScript front-end will need to poll the server for relevant events and changes.

如果不使用Java小程序或类似程序,您的HTML / JavaScript前端将需要轮询服务器以查找相关事件和更改。

On the backend, there are a multitude of ways to implement a distributed event queue or similar to share between individual processes serving requests.

在后端,有多种方法可以实现分布式事件队列或类似方法在服务请求的各个进程之间共享。

#4


Ajax,SUP and XMPP will help you in this regard. Also study how Twitter Search and Friendfeed works.

Ajax,SUP和XMPP将在这方面为您提供帮助。还要研究Twitter Search和Friendfeed的工作原理。

#5


Comet, although not always appropriate, in a sense it is "polling", although it only polls once at the beginning of a potentially long'ish job; the server then keeps the HTTP connection open until it is ready to respond.

彗星,虽然并不总是合适,但在某种意义上说它是“民意调查”,尽管它只是在一个潜在的长期工作开始时才进行一次民意调查;然后,服务器保持HTTP连接打开,直到它准备好响应。

As defined by Wikipedia: "In web development, Comet is a neologism to describe a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it."

正如*所定义的那样:“在网络开发中,Comet是一个描述Web应用程序模型的新词,其中长期持有的HTTP请求允许Web服务器将数据推送到浏览器,而浏览器没有明确请求它。”

Found this to be useful for a job that may take the server five minutes to finish, instead of polling every x seconds, the client makes the request and the server essentially says "hang on..." and does it the work and returns the data when completed.

发现这对于可能需要服务器完成五分钟的工作非常有用,而不是每隔x秒轮询一次,客户端发出请求并且服务器基本上说“挂起......”然后执行工作并返回数据完成后。

There are several libraries that support this type of Ajax implementation including Dojo (dojo.com) and ExtJS 3.0 (extjs.com).

有几个库支持这种类型的Ajax实现,包括Dojo(dojo.com)和ExtJS 3.0(extjs.com)。

#6


We have developed a operational transformation engine, the technology backend that powers Google Wave, and did simultaneous drawing and text editing demos available using DuplexChannel on Silverlight. You can download it from http://www.corvalius.com/blog/index.php/technology/announcing-the-availability-of-the-beweevee-sdk-september-ctp/ .

我们开发了一个操作转换引擎,为Google Wave提供支持的技术后端,并使用Silverlight上的DuplexChannel进行同步绘图和文本编辑演示。您可以从http://www.corvalius.com/blog/index.php/technology/announcing-the-availability-of-the-beweevee-sdk-september-ctp/下载。

We plan to release the SDK (that it is in preview right now) completely free for non-commercial/academic purposes; so it may be of your interest to take a look. At least you will be able to find a very simple example of how to do full duplex for collaborative apps in source (small WCF server included).

我们计划完全免费发布SDK(现在正在预览中)用于非商业/学术目的;所以看看你可能是有兴趣的。至少您将能够找到一个非常简单的示例,说明如何在源中为协作应用程序执行全双工(包括小型WCF服务器)。

#7


Since its a Web app, I'd suggest you to try etherpad!

由于它是一个Web应用程序,我建议你尝试使用etherpad!

There is a .NET Client example on HTTP API and a page on other examples

HTTP API上有一个.NET Client示例,其他示例上有一个页面