A secure, reliable binding suitable for cross-machine communication.
Public Class NetTcpBinding _ Inherits Binding _ Implements IBindingRuntimePreferences
Dim instance As NetTcpBinding
public class NetTcpBinding : Binding, IBindingRuntimePreferences
public ref class NetTcpBinding : public Binding, IBindingRuntimePreferences
public class NetTcpBinding extends Binding implements IBindingRuntimePreferences
The NetTcpBinding generates a run-time communication stack by default, which uses transport security, TCP for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for communicating over an Intranet.
The default configuration for the NetTcpBinding is faster than the configuration provided by the WSHttpBinding, but it is intended only for WCF-to-WCF communication. The security behavior is configurable using the optional securityMode parameter in the constructor. The use of WS-ReliableMessaging is configurable using the optional reliableSessionEnabled parameter. But reliable messaging is off by default. More generally, the HTTP system-provided bindings such as WSHttpBinding and BasicHttpBinding are configured to turn things on by default, whereas the NetTcpBinding binding turns things off by default so that you have to opt-in to get support, for example, for one of the WS-* specifications. This means that the default configuration for TCP is faster at exchanging messages between endpoints than that configured for the HTTP bindings by default.
This example shows how to create a NetTcpBinding, setting the security mode and transport credential type.
NetTcpBinding binding = new NetTcpBinding(); binding.Security.Mode = SecurityMode.Transport; binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate;
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003