title: timeoutexception or default connection limit on wcf?
body: <p>I firstly launched my subscriber for my WCF service and proceed to publish a posting from my publisher. My subscriber is able to receive the posting.</p>
  
  <p>Secondly I closed my FIRST subscriber and open it again to subscribe to the same service which is so called the SECOND subscriber that has subscribed to the service. And once again, it is able to receive a posting.</p>
  
  <p>Once I repeat this for the third time, there would be a exception of</p>
  
  <blockquote>
    <p>The message could not be transferred within the allotted timeout of 00:01:00. There was no space available in the reliable channel's transfer window. The time allotted to this operation may have been a portion of a longer timeout.</p>
  </blockquote>
  
  <p>Summary :</p>
  
  <ol>
  <li> On first client, SUBSCRIBED , everything works fine
  <li> Closes first client
  <li> On the cilent AGAIN , (meaning second connection on the same service(?)) , everything works fine
  <li> Closes "second client"
  <li> Opens the client for the THIRD time, error occurs
  </ol>
  
  <p>From what I have researched so far, I have seen that in this question, it mentioned that the default connection limit is 2?</p>
  
  <p><a href="https://stackoverflow.com/questions/2454362/wcf-service-throttling">WCF Service Throttling</a></p>
  
  <p>Is that the issue that is causing my error? IF yes, is it possible to adjust the limit of the connection and how?</p>
  
  <p>Pretty new in the WCF area and welcome anybody to give me their opinion.
  Thanks!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Tried using UseSynchronizationContext = false on my client. As everytime a posting is sent, my PostReceived() method for my subscriber includes opening a popup windows form containing the information of the posting. When using UseSynchronizationContext = false, the windows form would not be able to open properly(an error here). </p>
  
  <p>Anyone has any idea how to fix that or have any alternate solutions?</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Been reading around lots of WCF connection related stuffs and found out that most people are trying to toggle the maxConnections variable or related in their config files. My question is the only config files I have is in my client and none for my Service project. Is it necessary for me to add a config file for my service project?</p>
  
  <p>As the "connection limit"(?) is 2, I tried the method of unsubcribing it when the client exits the application but that doesn't work and gives me and error. I have posted a question on the error that I received. </p>
  
  <p><a href="https://stackoverflow.com/questions/8395525/objectdisposedexception-on-wcf-service">https://stackoverflow.com/questions/8395525/objectdisposedexception-on-wcf-service</a></p>
  
  <p>Config Codes for Client side added :</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;diagnostics performanceCounters="All" /&gt;
    &lt;bindings&gt;
      &lt;wsDualHttpBinding&gt;
        &lt;binding name="WSDualHttpBinding_IPostingContract" clientBaseAddress="http://localhost:8000/wcfClient/" closeTimeout="00:01:00"
            openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"&gt;
          &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384"  /&gt;
          &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" /&gt;
          &lt;security mode="Message"&gt;
            &lt;message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" /&gt;
          &lt;/security&gt;
        &lt;/binding&gt;
      &lt;/wsDualHttpBinding&gt;
    &lt;/bindings&gt;
  
    &lt;client&gt;
      &lt;endpoint address="http://localhost:8888/PostingContract/Posting"
          binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPostingContract"
          contract="IPostingContract" name="WSDualHttpBinding_IPostingContract"&gt;
        &lt;identity&gt;
          &lt;userPrincipalName value="##" /&gt;
        &lt;/identity&gt;
      &lt;/endpoint&gt;
    &lt;/client&gt;
  
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Would someone advise me if I have done anything wrong for my service part with regards to the behaviors or the config files. Appreciate a million. Thanks!</p>
  
  <p><strong>EDIT 3</strong></p>
  
  <p>Manage to play around with the service behavior. For the behavior, I changed the InstanceContextMode to single.</p>
  
  <pre><code>InstanceContextMode = InstanceContextMode.Single
  </code></pre>
  
  <p>and that actually allowed me to launch more than 2 connections of my windows form app. However if I do that, If I had launch 2 connections beforehand, for the third connection it will receive 3 popups, and subsequently for the forth connection, it will receive 4. When it is suppose to receive 1.</p>