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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:44:09+00:00 2026-06-04T01:44:09+00:00

I’ve written a system that uses a Duplex NetTcp Channel with a callback to

  • 0

I’ve written a system that uses a Duplex NetTcp Channel with a callback to function as a publish/subscribe server.

Do I have to worry about the callback timing out if not connection is sent after a while or will the callback pipe be maintained indefinitely?

  • 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-04T01:44:10+00:00Added an answer on June 4, 2026 at 1:44 am

    The callback won’t be maintained indefinitely, It will look for the timeout values you’ve set in your config. If you enable reliable sessions then you can set the inactivity timeouts of your clients. You can configure timeouts like this:

     <netTcpBinding>
        <binding 
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00" 
                 receiveTimeout="00:10:00" 
                 sendTimeout="00:01:00"
                 transactionFlow="false" 
               ......>
            <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true" />
        </binding>
      </netTcpBinding>
    

    When these values are reached and there is still no response, your communication channel becomes faulted and you need to re-create a client proxy to consume the service. The default value for receiveTimeout is 10 minutes so you can increase that, but also make sure to increase your inactivityTimeout as well, your inactivityTimeout should be greater than your receiveTimeout.

    EDIT:

    You could keep changing your receiveTimeout programmatically based on values your client sends back to the server, the key is keeping the new timeout values same on the service and client.
    You would go about doing this on the client (an example I’m taking from a chat service I’m making with WCF and consuming with Silverlight clients):

    //Create different clients dynamically
    MyChatServiceClient _client1 = new MyChatServiceClient( "NetTcpBinding_IMyChatService_1");
    MyChatServiceClient _client2 = new MyChatServiceClient( "NetTcpBinding_IMyChatService_2");
    

    In the client configuration:

    <!--In your config file, define multiple endpoints/behaviors with different values based on your needs-->
            <bindings>
                <customBinding>
                    <binding name="NetTcpBinding_IMyChatService_1" receiveTimeout="00:01:00" ...>
                        <binaryMessageEncoding />
                        <tcpTransport maxReceivedMessageSize="283647" maxBufferSize="283647" />
                    </binding>
                    <binding name="NetTcpBinding_IMyChatService_2" receiveTimeout="00:22:00" ...>
                        <binaryMessageEncoding />
                        <tcpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
                    </binding>
                </customBinding>
            </bindings>
            <client>
                <endpoint address="net.tcp://192.168.1.51:4520/VideoChatServer/"
                    binding="customBinding" bindingConfiguration="NetTcpBinding_IMyChatService_1"
                    contract="IMyChatService" name="NetTcpBinding_IMyChatService_1" />
    
              <endpoint address="net.tcp://192.168.1.51:4522/VideoChatServer/"
                    binding="customBinding" bindingConfiguration="NetTcpBinding_IMyChatService_2"
                    contract="IMyChatService" name="NetTcpBinding_IMyChatService_2" />
            </client>
    

    So you can define multiple endpoints or bindings in the config on your client or your server, then based on whatever
    event in your application you can instantiate _clientProxyX to consume _serviceInstanceX which will have different binding/endpoint values
    but the same contract as your previous service instance. In the example above the first binding has a timeout of 1 minute,
    the second binding 2 minutes. An important point to consider is that if you wish to recreate new client proxies like this, then you need to tear down your old client
    proxy and crate a new one, which effectively disconnects your clients from the service, at least momentarily.

    Also you can modify those values (openTimeout, closeTimeout etc.) programmatically on both the server when instantiating a new service host.
    You can create a new host, based on one of the binding configurations you’ve defined in your config,
    or create a new config programmatically, something like this:

    var host = new ServiceHost(typeof(MyChatService));
                var webHttpBinding = new System.ServiceModel.WebHttpBinding();
                //Modify new timeout values before starting the host
                webHttpBinding.OpenTimeout = new TimeSpan(1, 0, 0);
                webHttpBinding.CloseTimeout = new TimeSpan(1, 0, 0);
                host.AddServiceEndpoint(webHttpBinding, "http://192.168.1.51/myService.svc");
                //start the host after necessary adjustments
                host.Open();
    

    This looks quite messy I know, but the point is WCF gives you a lot of flexibility in being able to modify you binding configs programmatically.
    Be sure to check out this great answer on modifying your WCF config files. And you can also easily create a whole service configuration programmtically.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.