Transports in WCF

Windows Communication Foundation supports four different transports:

  • HTTP
  • TCP
  • MSMQ
  • Named Pipes

These transports are the medium in which communication takes place in a channel. Some of these transports have built-in security, and others do not. For example, HTTP has HTTPS.
The HTTP transport is useful when connection state does not need to be maintained, such as a web-browser
client communicating with a web server. Because the HTTP protocol is not connection-based, no connection state is maintained once the response is sent. However, the HTTP protocol is very useful in interoperability with legacy systems.
TCP is useful when connection-based communication is important. In this scenario, a communication session between participants is created prior to the exchange of data. If all communicating participants are using WCF, bindings using this protocol or the Named Pipes protocol perform better. The TCP transport in WCF is specifically designed for the scenario where both participants are using WCF.
Named Pipes is useful for single machine processing between processes. It can be used for single (oneway) or duplex communication between processes on a single computer. This transport should be used when communication from another machine is to be prevented and communication between WCF applications on the same machine is required.
The MSMQ transport can be used when the reliable delivery of messages is required.
As you select your transport, keep in mind the target environment and the platforms you might encounter, especially if your channel crosses boundaries (a domain boundary, geographic boundary, and so on). The transport you select can have a performance and communication cost associated with it.

Tagged . Bookmark the permalink.

Leave a Reply