locked
Server detection of client timeout RRS feed

  • Question

  • User-357729547 posted

    HTTP Rest... (WebInvoke) Is there a way of detecting on server side if and when a client receives a timeout ??? I'm implementing a WCF long polling service, and would like to know when the client receives a timeout and restarts the long polling HTTP call.. 

    Thursday, May 2, 2013 3:32 PM

Answers

  • User220959680 posted

    ooking for an EVENT on SERVER side (so, not client), that a channel has timed out.

    configuration for the Service and Client suggested above.  Note that below configuration is for the Service (copied from above), which impact the service timeout behavior.

    <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding openTimeout="00:10:00"
                     closeTimeout="00:10:00"
                     sendTimeout="00:10:00"
                     receiveTimeout="00:10:00">
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>


    By configuring above it is quite feasible to increase/decrease the timeouts for the service. Note that same can be done at client side, BUT the service has to support/have the same configuration.

    can read more at http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 3, 2013 4:54 AM

All replies

  • User220959680 posted

    Client-side Timeouts

    On the client side:

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

    2. OpenTimeout – used when opening channels when no explicit timeout value is specified

    3. CloseTimeout – used when closing channels when no explicit timeout value is specified

    4. ReceiveTimeout – is not used

    Client-side Timeouts

    On the service side:

    1. SendTimeout, OpentTimeout, CloseTimeout are the same as on the client

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

    Timeouts in binding in Service

     <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding openTimeout="00:10:00" 
                     closeTimeout="00:10:00" 
                     sendTimeout="00:10:00" 
                     receiveTimeout="00:10:00">
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>



    Thursday, May 2, 2013 5:26 PM
  • User-357729547 posted

    Hi .. thx for the effort, but not what I was looking for. I am looking for an EVENT on SERVER side (so, not client), that a channel has timed out.

    I've looked at OperationContect.Current.Channel.Closed and Faulted, but they don't get triggered on timeout. 

    Friday, May 3, 2013 4:18 AM
  • User220959680 posted

    ooking for an EVENT on SERVER side (so, not client), that a channel has timed out.

    configuration for the Service and Client suggested above.  Note that below configuration is for the Service (copied from above), which impact the service timeout behavior.

    <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding openTimeout="00:10:00"
                     closeTimeout="00:10:00"
                     sendTimeout="00:10:00"
                     receiveTimeout="00:10:00">
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>


    By configuring above it is quite feasible to increase/decrease the timeouts for the service. Note that same can be done at client side, BUT the service has to support/have the same configuration.

    can read more at http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 3, 2013 4:54 AM