2
0
Эх сурвалжийг харах

PeeDuplex ChannelFactory must be opened in prior to create channels.

Atsushi Eno 15 жил өмнө
parent
commit
7570eef1b6

+ 6 - 1
mcs/class/System.ServiceModel/System.ServiceModel.Channels/PeerDuplexChannel.cs

@@ -207,8 +207,13 @@ namespace System.ServiceModel.Channels
 			var binding = new NetTcpBinding ();
 			binding.Security.Mode = SecurityMode.None;
 			var channel_factory = new DuplexChannelFactory<IPeerConnectorClient> (conn.Instance, binding);
+			channel_factory.Open ();
 
-			return channel_factory.CreateChannel (new EndpointAddress ("net.p2p://" + node.MeshId + "/"), conn.Address.EndpointAddress.Uri);
+			var ch = channel_factory.CreateChannel (new EndpointAddress ("net.p2p://" + node.MeshId + "/"), conn.Address.EndpointAddress.Uri);
+			ch.Closed += delegate {
+				channel_factory.Close ();
+				};
+			return ch;
 		}
 
 		public override void Send (Message message, TimeSpan timeout)