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 3595348
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:50:24+00:00 2026-05-18T19:50:24+00:00

Periodically, the duplex Net.TCP connection between our Silverlight application and our WCF web service

  • 0

Periodically, the duplex Net.TCP connection between our Silverlight application and our WCF web service will enter the faulted state — for instance, due to transient network issues, or if the service crashes and restarts, things like that. When that happens, I’d like to catch this, and re-open the connection. Sounds straightforward, right? You should be able to do something like this:

private void Channel_Faulted(object sender, EventArgs e)
{
    client.CloseCompleted += (sender, e) =>
        {
            if (e.Error == null)
                client = CreateClient();
            else
                Debug.WriteLine(e.Error.ToString());
        };
    client.CloseAsync();
}

But when I try that the e.Error in the CloseCompleted handler has this exception:

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

I’ve tried a whole bunch of variations on this same theme, including:

  • Not closing the connection after it faults and just recreating it.
  • Calling client.InnerChannel.Close() and/or client.ChannelFactory.Close() manually.
  • calling client.InnerChannel.Dispose() and/or client.ChannelFactory.Dispose() manually.
  • Lots of other stuff that I’ve forgotten now.

These strategies have resulted in a variety of errors, but none of have worked correctly, including the sort of non-Silverlight solutions mentioned, say, here or here (but all for regular CLR apps, not Silverlight). Surely this is a fairly straightforward thing to do, but apparently the channel caching is getting in my way. What am I missing? What’s the right way to do this in Silverlight? If this is a bug in Silverlight, what’s the right workaround?

  • 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-18T19:50:25+00:00Added an answer on May 18, 2026 at 7:50 pm

    As with most things that seem to be working in inexplicable ways, the problem was my fault. The actual code I’m working with is (not surprisingly, I hope) significantly more complicated than the simplified version I posted above. And it turns out that in my real code, in the particular code path that I was testing, the equivalent of this line was never being called:

    client = CreateClient();
    

    In other words, the client wasn’t actually getting recreated after throwing a fault, and the errors I was running into primarily resulted from trying to re-use an old instance. Sorry for the fuss.

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

Sidebar

Related Questions

I'm working an application that periodically fetch data from a web service. The problem
I'm trying to write application that periodically receives e-mails. It writes every mail into
I need to flush the index periodically.that's mean that the index will be regularly
I'd like to periodically create a backup of my github repositories. Is there a
I should implement periodically popup form at other form. This popup form isn't common
I am building a little daemon which periodically (every 30 seconds) checks for new
I know use AJAX to periodically poll server for the command can achieve this,
One of my programs crashes periodically, but I don't know why. I'm running it
I have the following timer which periodically updates my page: var refreshId = setInterval(function()
Is there a way to periodically run an elisp function in a long-running emacs,

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.