Is MarshalByRefObject special?

前端 未结 2 1996
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 08:53

.NET has a thing called remoting where you can pass objects around between separate appdomains or even physical machines. I don\'t fully understand how the magic is done, he

2条回答
  •  失恋的感觉
    2020-12-13 09:15

    The magic seems to be in a special TransparentProxy class - the .NET Runtime handles it in a special way.

    • If you want to use it, see an article about RealProxy
    • If you want to read more about the "magic", see an article on TransparentProxy implementation.
    • For a basic overview, try the MSDN article "Remoting: A Technical Overview".

    I think that MarshalByRefObject may contain some additional internal information which can be helpful for this mechanism, but I haven't looked much into that.

提交回复
热议问题