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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:54:02+00:00 2026-05-20T10:54:02+00:00

I am creating a client service application using WCF duplex callback. The service sends

  • 0

I am creating a client service application using WCF duplex callback. The service sends messages to all connected clients. I am storing all connected clients in the dictionary. Before sending message to the client I want to check if any client has shutdown abnormally (network disconnection, power off).

@marc_s: I created a CheckCallbackChannels method which will check for Communication State of a connected clients in the dictionary.

Sub CheckCallbackChannel()
    For Each objClient As KeyValuePair(Of Guid, IClientCallBack) In MainService.objClients
        Dim objClientCallBack As IClientCallBack = MainService.objClients.Item(objClient.Key)
        Dim callbackChannel As ICommunicationObject = TryCast(mobjClientCallBack,ICommunicationObject)
        'Dim state As CommunicationState = callbackChannel.State
        If callbackChannel.State = CommunicationState.Opened OrElse callbackChannel.State = CommunicationState.Faulted Then
            MainService.objClients.Remove(objClient.Key)
        End If
    Next
End Sub

but here i get the state as connected for faulty clients also.

  • 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-20T10:54:02+00:00Added an answer on May 20, 2026 at 10:54 am

    Yes, you could include a Ping() method on each service contract, and call that before your actual call.

    But what does that really tell you??

    First of all, even the call to .Ping() could result in an exception (since the service is gone, overloaded, whatever).

    And if it succeeds – it gives you absolutely no guarantee that your next call to that same service, a microsecond later, has any chance of succeeding….

    Basically, I find this approach wasteful – you need to write a lot of code, and in the end, it really doesn’t give you any meaningful information.

    What you need to do is: be prepared on every service call that it can fail – for whatever reason. Don’t waste your time and processing cycles pinging around all over your system – it doesn’t give you any meaningful info anyway.

    Just make your service calls, be prepared to handle failures (and possibly recycle your WCF proxies) – and that’s all you can really do.

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

Sidebar

Related Questions

I have a WCF service and I am creating the client using the Add
I am creating a WCF web service using wsHttpBinding and a corresponding application that
I've been creating a an application with C# using W2k8+IIS7/SQLExpress 2008/Web Service/Windows Client. I'll
We are creating a WCF service with a companion client DLL (.Net) that we
I have client-server application, where server side is Azure WCF service with data in
I'm creating a smart client application using .NET 3.5. A Winforms client connecting through
I'm using WCF Dataservice / EF 4.1 and a WPF Client application. Here is
We are consuming wcf services on the silverlight application trough creating proxies using ChanellFacotry.
I'm creating a client contact using Membership.CreateUser and I'd like to supply a generated
I am creating a desktop/client application that will be installed on +/- 5 PCs,

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.