Patrice Cote
Patrice Cote

Reputation: 3716

WCF timeout client vs server

Can anyone explain to me what is the difference between the timeout configuration on the server vesus on the client ? For example, what would happen if a client sets the sendTimeout to 5 minutes while the configuration on the server has it set for 1 minute ? Does the client prevail since it initiates the communication ?

Thanks for your help !

Upvotes: 10

Views: 9470

Answers (2)

Henrique Müller
Henrique Müller

Reputation: 39

In tests the scenario that you asked. The timeout of the request is 5 minutes, which was defined in the client

On the Client-side Timeouts

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.

ReceiveTimeout – is not used

On the Service-side Timeouts

SendTimeout are the same as on the client

ReceiveTimeout – used by the Service Framework Layer to initialize the session-idle timeout which controls how long a session can be idle before timing out.

See https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/configuring-timeout-values-on-a-binding

Upvotes: 0

Shreedhar Kotekar
Shreedhar Kotekar

Reputation: 1124

I think I got this, take a look at http://omsite.blogspot.com/2008/04/playing-with-wcf-nettcpbinding-timeouts.html.

When client initiates the call to server, the client side sendTimeout and server side receiveTimeout are in effect. The client has to send(or push) all the data before receiveTimeout set on server expires. The server has to complete its operation and return the results back to client before the sendTimeout set on the client expires.

If the roles are reversed, meaning server is opening communication back to client (like in a callback etc), then sendTimeout on server and receiveTimeout on client come into play.

There is also OpenTimeout and CloseTimeout which control the channel connection establishing timeouts and work at lower channel levels (line sockets etc)

Upvotes: 1

Related Questions