title: Service Fabric Multiple Communication Listeners
body: <p>Basic Idea - I have a stateless service that implements an Owin communication Listener over http to service WebApi based public clients.  I want to add a second listener that will receive requests within the cluster over Rpc using the built in ServiceRemotingListener().  The reason is that I don't want this listener to be public as it implements a non-public management interface for the stateless service.  Here is the setup...:</p>
  
  <pre><code>        protected override IEnumerable&lt;ServiceInstanceListener&gt; CreateServiceInstanceListeners()
      {
          return new[]
          {
              new ServiceInstanceListener(initParams =&gt; new OwinCommunicationListener("MyWebService", new Startup(_options, this), initParams),"MyServiceHttp"),
              new ServiceInstanceListener(initParams =&gt; new ServiceRemotingListener&lt;Interfaces.IConfig&gt;(initParams, this),"MyServiceRpc")           
          };
      }
  </code></pre>
  
  <p>When I add the second listener, I get an exception starting the app...</p>
  
  <pre><code>                 this.serverHandle = WebApp.Start(this.listeningAddress, appBuilder =&gt; this.startup.Configuration(appBuilder));
  </code></pre>
  
  <blockquote>
    <p>Exception thrown: 'System.Net.Sockets.SocketException' in System.dll
    Exception thrown: 'System.ServiceModel.CommunicationException' in System.ServiceModel.dll
    Exception thrown: 'System.ServiceModel.CommunicationException' in System.ServiceModel.dll
    Exception thrown: 'System.ServiceModel.CommunicationException' in System.ServiceModel.Internals.dll
    --multiple repeats---
    Exception thrown: 'System.ServiceModel.CommunicationException' in System.Fabric.dll</p>
  </blockquote>
  
  <p>(not sure how to get the exception details.  My "try {} " surrounding
   did not trap an exception.)</p>
  
  <p>Once in this state, I get subsequent exceptions as the service attempts to auto-restart - the errors are about port sharing.</p>
  
  <p>Anything I can do to make WebApi communication listeners work alongside ServiceRemotingListener?  I am assuming at this point that under the hood, ServiceRemotingListener is using http as well and they don't play nicely together.</p>