WCF - when to use netTcpBinding

I usually use HTTP binding for my services.
I read that the net.tcp binding is faster, however I'm not quite sure when should I use it?
what is the best practice, are there any flaws?

thanks

+6
source share
1 answer

The MSDN page for NetTcpBinding says it is better

The default configuration for NetTcpBinding is faster than the configuration provided by WSHttpBinding, but is for WCF-WCF exchange only.

Thus, NetTcpBinding is good to use when you have a .NET WCF client and a .NET WCF server, however if you need to support clients that are not written in .NET WCF (for example, you publish a public service, but you don’t know what language the client will be written in), then you need to use HttpBinding instead.

This page provides a good brief description of each type of binding and when they should be used.

  • BasicHttpBinding . A binding that is suitable for interacting with WS-Basic profiled web services, such as ASP.NET. Web Services (ASMX). This binding uses HTTP as transport and text / XML as the default message encoding.
  • WSHttpBinding . Safe and compatible binding, suitable for contracts without duplex.
  • WS2007HttpBinding . Secure and compatible bindings that support the correct security versions, ReliableSession, and TransactionFlow.
  • WSDualHttpBinding . Secure and compatible binding, suitable for bilateral service contracts or messaging through SOAP intermediaries.
  • WSFederationHttpBinding is a secure and compatible binding that supports the WS-Federation protocol, which allows organizations that are in the federation to efficiently authenticate and authorize users.
  • WS2007FederationHttpBinding . Secure and compatible binding that originates from WS2007HttpBinding and supports federated security.
  • NetTcpBinding . Secure and optimized binding, suitable for machine-to-machine communication between WCF applications.
  • NetNamedPipeBinding . A safe, reliable, optimized binding that is suitable for computer interaction between WCF applications.
  • NetMsmqBinding is a queue binding that is suitable for machine-to-machine communication between WCF applications.
  • NetPeerTcpBinding - A binding that provides secure, multi-machine communication.
  • WebHttpBinding . The binding used to configure endpoints for WCF web services that are displayed via HTTP requests instead of SOAP. messages.
  • MsmqIntegrationBinding . Binding suitable for machine-to-machine communication between a WCF application and an existing Message Queuing (also known as MSMQ).
+3
source

Source: https://habr.com/ru/post/955359/


All Articles