Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF通道工厂异常_C#_Wcf - Fatal编程技术网

C# WCF通道工厂异常

C# WCF通道工厂异常,c#,wcf,C#,Wcf,我试图建立与另一台电脑的连接,但后来我尝试创建一个频道。我遇到一个例外,我不知道是什么导致了这个问题,因为某些电脑是这样的 代码如下: var ep = "net.tcp://" + targetIpAddress + ":9985/IBC"; NetTcpBinding binding = new NetTcpBinding(SecurityMode.None); binding.ListenBacklog = 2000; binding.MaxConnections = 2000; bind

我试图建立与另一台电脑的连接,但后来我尝试创建一个频道。我遇到一个例外,我不知道是什么导致了这个问题,因为某些电脑是这样的

代码如下:

var ep = "net.tcp://" + targetIpAddress + ":9985/IBC";
NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
binding.ListenBacklog = 2000;
binding.MaxConnections = 2000;
binding.TransferMode = TransferMode.Buffered;
binding.MaxReceivedMessageSize = 1048576;
binding.SendTimeout = new TimeSpan(0, 1, 0);

ChannelFactory<IBlissRequest> pipeFactory = new ChannelFactory<IBlissRequest>(binding, new EndpointAddress(ep)); //here i get the exception
client.ChannelFactory = pipeFactory;

此代码由多个线程访问,当我在其周围设置锁时,问题似乎已解决(问题可能是它试图使用相同的IP地址建立重复连接)

您的完整堆栈跟踪是什么?我在问题中为您发布了它
bij System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
bij System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
bij System.ServiceModel.Description.TypeLoader.GetKnownTypes(Object[] knownTypeAttributes, ICustomAttributeProvider provider) 
bij System.ServiceModel.Description.TypeLoader.UpdateOperationsWithInterfaceAttributes(ContractDescription contractDesc, ContractReflectionInfo reflectionInfo) 
bij System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation) 
bij System.ServiceModel.ChannelFactory`1.CreateDescription() 
bij System.ServiceModel.ChannelFactory.InitializeEndpoint(Binding binding, EndpointAddress address) 
bij System.ServiceModel.ChannelFactory`1..ctor(Binding binding, EndpointAddress remoteAddress) 
bij System21.Network.InterBlissCommunication.InternalMethodInvoke(String targetIpAddress, Boolean Async, Object state, CallbackMethod callbackMethod, BpuMethod MethodName, Object[] Parameters)