Using Matlab desktop with .NET remoting

2 visualizaciones (últimos 30 días)
Mike Daneman
Mike Daneman el 12 de En. de 2019
Editada: Mike Daneman el 25 de En. de 2019
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");
}

Respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by