In .Net Remoting, if you don't specify a remot

2019-08-15 06:55发布

问题:

Context

I've inherited a .NET Remoting application which is having a problem where clients hang when trying to register shared objects with the server. This registration occurs an arbitrary period of time after the server is started with a call to 'register' on a shared ILease object.

In the process of following the code path, I am trying to figure out where calls to RemotingServices.Marshal and RemotingServices.RegisterWellKnownSericeType are storing their information. My previous question's answer lead me to understand that applications specify the service that stores this information in either the .exe's configuation file, or using the RemotingConfiguration.RegisterWellKnownClientType call, as corroborated here.

Question

Our application uses neither a configuration file nor RegisterWellKnownClientType to register a remoting service, but uses .NET remoting successfully. I haven't been able to figure out from .NET's open-source reference code or from the articles through which I've looked what 'default' service is used for .NET Remoting. So, does anyone know what the default settings used for .NET Remoting service are?

Thanks!

回答1:

As suggested by Andy in the comments of the linked question, the answer is that there's a third option for registering a communication system for the .NET Remoting runtime: directly registering a TCP channel object with the remoting services. E.g.:

TcpChannel.TcpChannel ipcChannel = new TcpChannel(...);
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel( ipcChannel, false );