How to set parameters of the WCF data transmission configuration file

Source: Internet
Author: User

The interpretation of these four attributes in msdn is a bit perfunctory.
Open/close/receive/send is the concept of HTTP/tcp/socket, read/write
Operation is Web
Service concept.

1. opentimeout

Timeoutexception is triggered if the connection between the client and the server is not completed after the specified time.

In TCP communication, the server must first prepare the listening port and listen on the port (Listen), and the client must first issue the connect command to the server, after the server receives the accept request, the connection is successful. Then the two can send messages to each other.
In the WCF field, similarly, open () indicates creating a binding.

Test: dial the network cable.

2. closetimeout

Similar to opentimeout,
Closetimeout is used to close a connection.

Generally, the client is relatively casual and does not care about this timeout exception. "Close () is issued by me, and I decide when to clean up the resource ."
It is different on the server. She must be responsible for the client and cannot mess up. Before receiving a successful response from close (), or before receiving a timeout exception, she cannot freely clear resources related to the client.

3. sendtimeout

Client call timeout. The default value is 1 minute. Each call must be completed within the specified time; otherwise, timeoutexception is triggered.

In TCP communication, after both parties establish a connection, if the client needs to send a message to the server, it will send a data packet to the server. After receiving the message, the server must provide a response, after receiving the response, the client can successfully send the message. Similarly, the server may actively send messages to the client. The two actions are send for both the client and server, and receive for the other side ).
However, the send concept in sendtimeout in WCF is similar to that in TCP send, but it is not the same thing in essence. Sending in sendtimeout refers to the client initiating a call.
On the WCF client, use proxy. innerchannel. operationtimeout to obtain the value of sendtimeout. (Here, proxy
Is an automatically generated instance of the Service proxy class xxxclient)

Test: insert MessageBox. Show (...) or thread. Sleep (...) into the call processing code of the server (...).

4. receivetimeout

Same as sendtimeout,
Receive in receivetimeout refers to the callback initiated by the server ). Applicable only for two-way communication binding, such as wsdualhttpbinding,
Nettcpbinding, netnamedpipebinding,

Receivetimeout is the time-out for server callback (callback). The default value is 10 minutes. Each callback must be completed within the specified time; otherwise, timeoutexception is triggered on the server.


5. maxbufferpoolsize = "524288", the maximum number of messages received from the channel is 2147483647
6. maxbuffersize = "65536" the cache size of messages received from the channel is 2147483647

7. maxconnections = "10" Max number of connections
8. maxcompute edmessagesize = "65536"> the maximum size of received messages is 2147483647.
<Readerquotas>
Specify the xmldictionaryreaderquotas of the complexity constraint for the exchanged SOAP message. The following remarks provide default values for these constraints.
These complexity constraints can defend against certain types of denial of service (DoS) attacks, which attempt to use message complexity to occupy the end point processing resources. The attributes that express these constraints and their default values are as follows:
The most important security feature of the dictionary reader is the quota. You must specify a quota instance for the dictionary reader factory method. The default constructor creates the "Security" default value (the same as the encoding default value), and the class has the static Max attribute, used to create a reader without a quota.
9. maxdepth = "32" Maximum node depth
10. maxstringcontentlength = "8192" maximum content length is 2147483647
11. maxarraylength = "16384" Maximum array Length
12. maxbytesperread = "4096" Maximum length of each read operation
13. maxnametablecharcount = "16384" the maximum number of nametablechar files is 2147483647.

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.