Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
NetTcpBinding Class
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
NetTcpBinding Class

Updated: November 2007

A secure, reliable binding suitable for cross-machine communication.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Visual Basic (Declaration)
Public Class NetTcpBinding _
    Inherits Binding _
    Implements IBindingRuntimePreferences
Visual Basic (Usage)
Dim instance As NetTcpBinding
C#
public class NetTcpBinding : Binding, 
    IBindingRuntimePreferences
Visual C++
public ref class NetTcpBinding : public Binding, 
    IBindingRuntimePreferences
J#
public class NetTcpBinding extends Binding implements IBindingRuntimePreferences
JScript
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.

C#
        NetTcpBinding binding = new NetTcpBinding();
        binding.Security.Mode = SecurityMode.Transport;
        binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista, Windows XP SP2, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker