Using Matlab desktop with .NET remoting

2 ビュー (過去 30 日間)
Mike Daneman
Mike Daneman 2019 年 1 月 12 日
編集済み: Mike Daneman 2019 年 1 月 25 日
Hello,
I'm having an issue trying to use Matlab with .NET remoting. I have a (non-matlab) .NET module that starts a remoting server. I have a separate DLL module that defines a class (ObjectGetter) with a function (GetProxy) that connects to the remoting server and returns the retrieved remote object as an .NET Interface (IMatRemoting). I have a 3rd DLL modules that defines the interface used by the remote object.
The remote server is running.
In Matlab desktop, I do the following:
NET.addAssembly('path to ObjectGetter class DLL');
NET.addAssembly('path to Interface DLL');
getter = ObjectGetterNameSpace.ObjectGetter;
proxy = getter.GetProxy();
None of this gives me any errors, but "proxy" is returned as a "MarshaByRefObject" instead of an "IMatRemoting" object. Therefore, I cannot call any methods on the remote object (since MarshalByRefObject doesn't have any of those methods). The "GetProxy" function return type is "IMatRemoting", so I'm not sure why the returned objects is being stored as MarshalByRefObject.
When I do the same thing using WCF, the returned object IS "IMatRemoting" and I CAN call its methods and get valid results. However, due to some limitations of WCF, I cannot use it and have to use Remoting.
The definition of "GetProxy" is below. I would really appreciate you help on this.
public IMatRemoting.IMatRemoting GetProxy()
{
IpcChannel ipcCh = new IpcChannel("myClient");
ChannelServices.RegisterChannel(ipcCh, false);
return (IMatRemoting.IMatRemoting)Activator.GetObject(typeof(IMatRemoting.IMatRemoting), "ipc://MatRemotingServer/MatRemoteObject");
}

回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

製品


リリース

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by