.NET 远程调用被应用于我的 旧有 应用程序中。我们决定为我们的远程调用方法设置超时时间。
System.Collections.IDictionary properties = new System.Collections.Hashtable();
properties["name"] = Ipc_Channel_Name;
properties["timeout"] = 1 * 1000;
IChannel clientChannel = new IpcClientChannel(properties, null);
ChannelServices.RegisterChannel(clientChannel, false);
问题是似乎超时没起作用。我通过将
System.Threading.Thread.Sleep(5 * 1000);
设置在被调用的代码中进行了检查。是因为IpcClientChannel不支持超时的原因吗?我该如何设置超时时间?