.NET:不相关的应用程序域之间的通道和接收器

发布于 2024-08-14 10:22:48 字数 426 浏览 1 评论 0原文

我的理解是,当创建新的应用程序域时,框架会隐式创建通道和接收器。如果没有,您就无法在一个应用程序域中创建对象并在另一个应用程序域中使用代理。

(这是一种理解;如果我错了,请纠正我。)

此外,如果出于远程处理目的而编组对象,则必须显式注册通道才能供其他人使用它。

(到目前为止是对的吗?)

这就是我的理解崩溃的地方。场景:

Appdomain 1:使用编组对象远程处理服务器,通道已注册。
Appdomain 2:希望使用编组对象的客户端。
Appdomain 3:用于插件。从 appdomain 1(服务器)内部创建,在 appdomain 1 和 3 之间创建上述隐式通道。

如果在 appdomain 3(插件)中创建对象,但要在 appdomain 2(客户端)中使用代理引用,则通道和水槽是必要的。我该怎么做?

I am of the understanding that when a new appdomain is created, the framework creates channels and sinks implicitly. If it didn't, you couldn't create an object in one appdomain and make use of a proxy in the other.

(This is an understanding; please correct me if I am wrong.)

Additionally, if an object is marshaled for remoting purposes, a channel must be explicitly registered in order for others to make use of it.

(Right so far?)

Here's where my understanding breaks down. Scenario:

Appdomain 1: Remoting server with a marshaled object, channel is registered.
Appdomain 2: Client wishing to make use of the marshaled object.
Appdomain 3: For a plugin. Created from within appdomain 1 (server), creating the aforementioned implicit channels between appdomains 1 and 3.

If an object is created in appdomain 3 (plugin) but the proxy reference is to be used in appdomain 2 (client), channel(s) and sinks are necessary. How do I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最美不过初阳 2024-08-21 10:22:48

答案是简单地在 appdomain 3(插件 appdomain)内注册一个通道。我认为两个应用程序域之间必须有更明确的管道,但似乎只要每个应用程序域注册了一个通道,远程处理基础设施就会处理其他所有事情。

The answer is to simply register a channel within appdomain 3 (plugin appdomain). I thought that there had to be more explicit plumbing between the two appdomains, but it seems that as long as each appdomain has a channel registered, the remoting infrastructure handles everything else.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文