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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:49:16+00:00 2026-06-03T03:49:16+00:00

Maybe I am implementing WCF improperly, but I seem to be getting a WCF

  • 0

Maybe I am implementing WCF improperly, but I seem to be getting a WCF exception while using NetNamedPipedBindings after making numerous calls.

Here is the high level of what I am doing. Basically, I am working on an out of proc exe and using WCF named pipes to communicate back and forth. I leave my host open via this attribute:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, 
    ConcurrencyMode = ConcurrencyMode.Multiple)]

Then, in my client I create a static DuplexChannelFactory that I instantiate once and then use as needed via:

channelFactory.CreateChannel().MakeCall();

I have added a Ping method just to make sure that the host is working properly (since the host will send events back that we do not want to miss without knowing). This Ping method runs once every 5 seconds and simply returns a true. However, after running for a couple of minutes I get a TimeoutException. Here is my exception trace:

Server stack trace: at
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan
timeout) at
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
timeout) at
System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
timeout) at
System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel
channel, TimeSpan timeout) at
System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan
timeout, CallOnceManager cascade) at
System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan
timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String
action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs, TimeSpan timeout) at
System.ServiceModel.Channels.ServiceChannel.Call(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
Object[] outs) at
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation) at
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message)

I have opened JustDecompile and see that this error is most likely happening here:

connection = this.connectionPoolHelper.EstablishConnection(timeout)

However, I do not see any reason why this would timeout after working for a couple of pings previously? What setting do I need to set to make this infinite and/or is there another way for me to implement this WCF event server (it is used for on-demand processing too) from the client or server side?

UPDATE

I make about 6 pings before I start to see the call attempt and no return.

  • 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-06-03T03:49:17+00:00Added an answer on June 3, 2026 at 3:49 am

    The problem was that you cannot call CreateChannel over and over it appears. There is no dispose method as this is just a proxy of my WCF interface. So, I just solved this by storing the reference to the proxy and recreating it if the host needed re-instantiated.

    You would think there would be some sort of documentation about this. It especially does not help when there are blogs that are written where they do call CreateChannel multiple times.

    UPDATE:

    Here is what I found as to how this should be solved…although it did not work for me.., but seems to for others

    Snipped code in case the link dies:

    You have to use a using that casts to IClientChannel, and then reset your reference inside the using. The channel will close properly, but your reference will remain open. Notice the casts

    using (IClientChannel client = (IClientChannel)channelFactory.CreateChannel())
    {
        var proxy = (IMyInterface)client;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While implementing a WCF client endpoint, my config file had the following endpoint entry:
I've got a client/server setup that I am implementing using a WCF Service (
Maybe this has already been answered and I am searching incorrectly, but here is
Maybe here is already such question, but I didn't find it. I have MVVM
Maybe I just don't know .NET well enough yet, but I have yet to
Maybe the need to do this is a 'design smell' but thinking about another
Maybe this is a dumb question, but is there any way to convert a
Maybe I'm just thinking about this too hard, but I'm having a problem figuring
Maybe my understanding of agile development isn't as good as it should be, but
I am implementing a WCF web service which interacts with a client whose code

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.