Using Matlab desktop with .NET remoting

조회 수: 14 (최근 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 CenterFile Exchange에서 Introduction 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