我正在使用 .Net 远程处理在两个对象之间建立双向通信线路。基本结构如下:
Instances of RemoteObjectA call methods on StaticObjectA.
Instances of RemoteObjectB call methods on StaticObjectB.
StaticObjectA needs to be able to call methods provided by RemoteObjectB.
StaticObjectB needs to be able to call methods provided by RemoteObjectA.
此设置的问题是 RemoteObjectA 中的循环引用获取 StaticObjectA 获取 RemoteObjectB 获取 StaticObjectB 获取 RemoteObjectA ...
我实现了一个接口 IRemoteObjectA 和 IRemoteObjectB 并从它们各自的接口中继承了远程对象,但随后设置远程处理失败。
如果这个问题的解决方案是:“不要使用远程处理”,我可以处理。只是想确保我没有错过一个简单的解决方案。