The explanation in msdn is a bit perfunctory.
Open/close/receive/send is the concept of HTTP/tcp/socket, and read/write operation is the concept of web service.
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: Call processing on the serverCodeInsert MessageBox. Show (...) or thread. Sleep (...).
4. receivetimeout
Similarly to sendtimeout, receive in receivetimeout indicates that the server initiates a callback ). Applicable only when binding two-way communication, 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.
Test: insert MessageBox. Show (...) or thread. Sleep (...) in the callback processing code of the client (...).