[Reprinted] WCF timeout knobs

Source: Internet
Author: User

Http://social.msdn.microsoft.com/forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d/

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

 

For your specific question, if you are using a session channel that requires network interaction at open () time, I wocould use opentimeout.

If not, you may have to use sendtimeout (but setting this to a small value wowould require all operation interactions to complete in a short period of time, which may be impractical if you are passing large messages or calling long-running request-reply operations ). another option is to cast the client channel to (icontextchannel) and set. operationtimeout to a small value for only the first method call, but then set it back to a normal value for subsequent cals.

note that in a number of cases, you may get feedback even if the timeout doesn't kick in. for example, using basichttpbinding (a simple non-session binding without RM), I find that if I invoke a client operation on a server that is not listening, I get an endpointnotfoundexception ("no connection cocould be made because the target machine actively refused it. ") in a second or two, regardless of the timeout values.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.