Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:31:29+00:00 2026-05-26T16:31:29+00:00

My service host is configured to close connection after 10 mins <wsHttpBinding> <binding receiveTimeout=00:10:00>

  • 0

My service host is configured to close connection after 10 mins

<wsHttpBinding>
    <binding receiveTimeout="00:10:00">
</wsHttpBinding>

In my client code before using service it is validated. If it is in closed/faulted state it will create a new one.

    public static T ValidateService<T>(ref T service) where T : class
    {
        if (service is IClientChannel)
        {
            IClientChannel channel = service as IClientChannel;
            CommunicationState state = channel.State;
            if (state == CommunicationState.Faulted || state == CommunicationState.Closed)
            {
                // thread safe logic to create new service 
            }
        }
    }

Problem is when channel is closed on server side and channel.State will still return Open state. After I do remote call I get faulted exception and due to receiveTimeout.

Is there any way to have inactivity timeout on client side? something like receiveTimeout="00:10:00" on server but with few seconds less so I can nicely close a channel from client if not used and than my ValidateService<T> logic will create a new one if needed.

For performance reasons I do not want to create new channel for every remote call because those can be very frequent.

I would like to avoid having heart beat poller for each of my services I am using in my communication.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:31:29+00:00Added an answer on May 26, 2026 at 4:31 pm

    You can’t avoid handling Faulted and Closed since it is always possible that some network problem or similar leads to a situation where you have to create a new Channel…

    EDIT – as per comment:

    In production I usually have a client implementation which handles certain exceptions by recreating the Channel and retrying… this takes care of the case you are describing and several other cases like network hickup etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to a WCF service with an in-code configured client. The
I prepared a wcf service host and configured with some binding information below. <system.serviceModel>
I understand the value of the three-part service/host/client model offered by WCF. But is
All of this is pertaining to WebHttp binding, hosted in a custom Service Host
I need to host a WCF service in IIS that exposes a wsHttpBinding. That
I've configured ssl usign httpcfg set ssl , after this I've written next code:
When trying to host my WCF service using Net Tcp channel through Windows Console,
I am trying to host a WCF service, using NetTcpBinding in a Windows service.
I am trying to host a WCF service that supports wshttpbinding and basichttpbinding .
I'm writing a sample console service host and I want to plug into WCF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.