After quite a bit of searching, I could not find the answer to this question.
What is exact difference between OperationTimeout
and SendTimeout
? I read OperationTimeout
is a subset of SendTimeout
and SendTimeout
includes writing message in the channel. If you give more details that would be great.
My second question is I have client call to a service where I just want to set timeout between soon after request sent to the server and soon after received reply from the server. How to set this timeout?
SendTimeout – used to initialize the OperationTimeout, which governs the whole process of sending a message, including receiving a reply message for a request/reply service operation. This timeout also applies when sending reply messages from a callback contract method.
SendTimeout is used to initialize the OperationTimeout, which governs the whole interaction for sending a message (including receiving a reply message in a request-reply case). This timeout also applies when sending reply messages from a CallbackContract method.
I'd like to propose reading this answer from Brian McNamara over on the MSFT forums:
Brief summary of binding timeout knobs...
Client side:
- SendTimeout is used to initialize the OperationTimeout, which governs the whole interaction for sending a message (including receiving a reply message in a request-reply case). This timeout also applies when sending reply messages from a CallbackContract method.
- OpenTimeout and CloseTimeout are used when opening and closing channels (when no explicit timeout value is passed).
- ReceiveTimeout is not used.
Server side:
- Send, Open, and Close Timeout same as on client (for Callbacks).
- ReceiveTimeout is used by ServiceFramework layer to initialize the session-idle timeout.
I know it is an old question and WCF has reached its end of life - nevertheless I stumbled upon this exact problem.
The answer which Vincent quoted from Brian McNamara is correct (SendTimeout
is used to initialize the OperationTimeout
). It is just not complete.
The SendTimeout
also covers the time which is used for sending (the write operation itself) the data! See the Microsoft Docs
This really makes a difference if you increase the OperationTimeout
for certain heavy services. But do not increase the SendTimeout
on the binding (for all services!) and a whole lot of data has to be transmitted via a poor line. That was the problem I ran into...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With