将同一对象远程处理为两个URI

将同一对象远程处理为两个URI

本文介绍了将同一对象远程处理为两个URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于外部限制,我必须通过两个URI提供对同一对象的远程访问.省略所有远程配置(似乎正确设置),总体思路是:

Due to external constraints, I have to provide remoting access to the same object through two URI''s. Omitting all the remoting configuration (which does seem to set up correctly), the general idea is:

m_RemotedComponent = new RemotedComponent();
RemotingServices.Marshal(m_RemotedComponent, remotingName1);
RemotingServices.Marshal(m_RemotedComponent, remotingName2);


这两个连接提供了一个组件所支持的不同接口.

无论两个元帅陈述出现在哪个顺序上,第一个陈述都起作用,而第二个陈述不起作用.连接到第二个URI后,我收到错误消息,提示该对象必须从MarshalByRefObject派生.但是,由于我总是可以成功实例化列在首位的URI,因此它显然是从中派生的.如果创建第二个RemotedComponent,则可以成功将其封送至第二个URI,因此问题显然与尝试将同一对象封送至两个URI有关.


The two connections provide different interfaces that the one component supports.

Regardless of which order the two Marshal statements appear, the first one works and the second one doesn''t. Upon connecting to the second URI, I get the error message saying that the object has to derive from MarshalByRefObject. But, since I can always instantiate the first-listed URI successfully, it obviously does derive from that. If I create a second RemotedComponent, I can marshal it successfully to the second URI, so the problem is clearly related to trying to marshal the same object to two URI''s.

这应该可行吗?如果是这样,怎么办?

Is this supposed to be possible? If so, how?

推荐答案


这篇关于将同一对象远程处理为两个URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 04:27