Search code examples
wcfconfigurationtimeoutwcf-binding

Timeouts WCF Services


How do the timeouts work in WCF? I know for example that you can configure sendTimeout and receiveTimeout for a clients binding. But how do they work?

MSDN describes sendTimeout as:

A TimeSpan value that specifies the interval of time provided for a send operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

What are send operations/receive operations?


Solution

  • 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.

    The source is Brian McNamara on MSDN forums.