Transmission of the foundation of WCF

Source: Internet
Author: User

Transmission of the foundation of WCF

The main transmission methods used in WCF are HTTP, TCP, and named pipe.

Binding includes three parts: Optional Protocol binding elements (such as security), required encoding binding elements, and required Transport Protocol binding elements, the transmission mode is determined by the transmission binding element.

HTTP is a request/response protocol between the client and the server. It is not based on a connection (that is, no communication session is required, we recommend that you use TCP to communicate with the named pipe.

TCP is the opposite of HTTP. It is based on connections and provides reliable transmission (TCP notifies the sender to start delivering packets to ensure that these packets are transmitted in the same order as when they are sent, transmission of lost packets and ensure that the data packets are not repeated). The TCP transmission of WCF is optimized based on the situation that both ends are based on WCF. Communication between different computers is achieved by using BinaryMessageEncodingBinddingElement encoding, TCP transmission also provides duplex communication.

The named pipe is an object in the Windows operating system kernel. It can be used for one-way or duplex communication between processes on a single computer. Communication is required between different WCF applications on the same computer, in addition, you can use a named pipeline to prevent any communication between the other computer.

 

If you select transmission, you need to select the message encoder to determine the situation in which the message exists in the transmission channel. The message encoder will not go into details as it was mentioned in the previous article. Here we will add three types of transmission quotas.

Timeout: This reduces the number of denial-of-service attacks that take up system resources for a long time.

Memory Allocation limit: prevents a single connection from consuming the system memory.

Set size limit: limits the consumption of indirect memory allocation or limited supply of resources.

 

Net. Tcp also has an important point: Port Sharing. Simply put, Port Sharing can reduce the number of ports exposed by the server, thus improving the security factor. To enable Port Sharing, you must first enable related windows functions, and then set protSharingEnabled = "true" in binding ".

<Binding name = "portSharedBiding" portSharingEnabled = "true">

 

Let's talk about it first. I have to take some time to read more books.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.