title: Single WCF Service to multiple client connections
body: <p>I have developed a VB.NET WCF service that recives and sends back data. When the first client connects it starts the data output that continues also if the client is closed. If a new client connects then a new object is created and the data output starts at the begninning and continues in parallel with the old instance. Is there a way to read the same service object from multiple clients?</p>
  
  <p>The service is self-hosted.</p>
  
  <p><strong>UPDATE:</strong> I solved the problem adding the following bit of code to the service class:</p>
  
  <pre><code>&lt;ServiceBehavior(ConcurrencyMode:=ConcurrencyMode.Multiple, 
      InstanceContextMode:=InstanceContextMode.Single)&gt;
      ...
  </code></pre>
  
  <p>To use the ServiceHost overload that takes in the SingletonInstance, the service must be tagged with the appropriate ServiceBehaviours.</p>