当前位置: 首页>>代码示例>>C#>>正文


C# NetTcpBinding.CanBuildChannelFactory方法代码示例

本文整理汇总了C#中System.ServiceModel.NetTcpBinding.CanBuildChannelFactory方法的典型用法代码示例。如果您正苦于以下问题:C# NetTcpBinding.CanBuildChannelFactory方法的具体用法?C# NetTcpBinding.CanBuildChannelFactory怎么用?C# NetTcpBinding.CanBuildChannelFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.ServiceModel.NetTcpBinding的用法示例。


在下文中一共展示了NetTcpBinding.CanBuildChannelFactory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefaultValues

		public void DefaultValues ()
		{
			var n = new NetTcpBinding ();
			Assert.AreEqual (HostNameComparisonMode.StrongWildcard, n.HostNameComparisonMode, "#1");
			Assert.AreEqual (10, n.ListenBacklog, "#2");
			Assert.AreEqual (false, n.PortSharingEnabled, "#3");

			var tr = n.CreateBindingElements ().Find<TcpTransportBindingElement> ();
			Assert.IsNotNull (tr, "#tr1");
			Assert.AreEqual (false, tr.TeredoEnabled, "#tr2");
			Assert.AreEqual ("net.tcp", tr.Scheme, "#tr3");

			Assert.IsFalse (n.TransactionFlow, "#4");
			var tx = n.CreateBindingElements ().Find<TransactionFlowBindingElement> ();
			Assert.IsNotNull (tx, "#tx1");

			Assert.AreEqual (SecurityMode.Transport, n.Security.Mode, "#sec1");
			Assert.AreEqual (ProtectionLevel.EncryptAndSign, n.Security.Transport.ProtectionLevel, "#sec2");
			Assert.AreEqual (TcpClientCredentialType.Windows/*huh*/, n.Security.Transport.ClientCredentialType, "#sec3");

			var bc = n.CreateBindingElements ();
			Assert.AreEqual (4, bc.Count, "#bc1");
			Assert.AreEqual (typeof (TransactionFlowBindingElement), bc [0].GetType (), "#bc2");
			Assert.AreEqual (typeof (BinaryMessageEncodingBindingElement), bc [1].GetType (), "#bc3");
			Assert.AreEqual (typeof (WindowsStreamSecurityBindingElement), bc [2].GetType (), "#bc4");
			Assert.AreEqual (typeof (TcpTransportBindingElement), bc [3].GetType (), "#bc5");
			
			Assert.IsFalse (n.CanBuildChannelFactory<IRequestChannel> (), "#cbf1");
			Assert.IsFalse (n.CanBuildChannelFactory<IOutputChannel> (), "#cbf2");
			Assert.IsFalse (n.CanBuildChannelFactory<IDuplexChannel> (), "#cbf3");
			Assert.IsTrue (n.CanBuildChannelFactory<IDuplexSessionChannel> (), "#cbf4");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:32,代码来源:NetTcpBindingTest.cs

示例2: MessageSecurityAndBindings

		public void MessageSecurityAndBindings ()
		{
			var n = new NetTcpBinding ();
			n.Security.Mode = SecurityMode.Message;
			
			Assert.AreEqual (SecurityAlgorithmSuite.Default, n.Security.Message.AlgorithmSuite, "#sec1");
			Assert.AreEqual (MessageCredentialType.Windows/*huh*/, n.Security.Message.ClientCredentialType, "#sec2");

			Assert.AreEqual (TransferMode.Buffered, n.TransferMode, "#sec3");

			var bc = n.CreateBindingElements ();
			Assert.AreEqual (4, bc.Count, "#bc1");
			Assert.AreEqual (typeof (TransactionFlowBindingElement), bc [0].GetType (), "#bc2");
			Assert.AreEqual (typeof (SymmetricSecurityBindingElement), bc [1].GetType (), "#bc3");
			Assert.AreEqual (typeof (BinaryMessageEncodingBindingElement), bc [2].GetType (), "#bc4");
			Assert.AreEqual (typeof (TcpTransportBindingElement), bc [3].GetType (), "#bc5");

			Assert.IsFalse (n.CanBuildChannelFactory<IRequestChannel> (), "#cbf1");
			Assert.IsFalse (n.CanBuildChannelFactory<IOutputChannel> (), "#cbf2");
			Assert.IsFalse (n.CanBuildChannelFactory<IDuplexChannel> (), "#cbf3");
			Assert.IsTrue (n.CanBuildChannelFactory<IDuplexSessionChannel> (), "#cbf4");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:22,代码来源:NetTcpBindingTest.cs

示例3: MessageSecurityAndBindings4

		public void MessageSecurityAndBindings4 ()
		{
			var n = new NetTcpBinding ();
			n.Security.Mode = SecurityMode.Message;
			n.Security.Message.ClientCredentialType = MessageCredentialType.Certificate;

			var bc = n.CreateBindingElements ();
			Assert.AreEqual (4, bc.Count, "#bc1");
			Assert.AreEqual (typeof (TransactionFlowBindingElement), bc [0].GetType (), "#bc2");
			Assert.AreEqual (typeof (SymmetricSecurityBindingElement), bc [1].GetType (), "#bc3");
			Assert.AreEqual (typeof (BinaryMessageEncodingBindingElement), bc [2].GetType (), "#bc4");
			Assert.AreEqual (typeof (TcpTransportBindingElement), bc [3].GetType (), "#bc5");

			Assert.IsFalse (n.CanBuildChannelFactory<IRequestChannel> (), "#cbf1");
			Assert.IsFalse (n.CanBuildChannelFactory<IOutputChannel> (), "#cbf2");
			Assert.IsFalse (n.CanBuildChannelFactory<IDuplexChannel> (), "#cbf3");
			Assert.IsTrue (n.CanBuildChannelFactory<IDuplexSessionChannel> (), "#cbf4");
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:18,代码来源:NetTcpBindingTest.cs


注:本文中的System.ServiceModel.NetTcpBinding.CanBuildChannelFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。