title: Recovering Broken Connections In A Peer to Peer Network
body: <p>I am implementing a peer to peer network using WCF NetPeerTcpBinding connections.</p>
  
  <p>I am using a central server which itself overrides the class CustomPeerResolverService. All this service does is register peers, and publish information about the peers to each other.</p>
  
  <p>On my server application I can visibly see which peers are currently connected on the GUI.</p>
  
  <p>My question is, each peer has a TCP connection to the server. When I unplug my network connection all connections to this server are severed. When the network comes back online those connections to the server are not re-established. What do I need to do to make sure they are re-established?</p>
  
  <p>Here is what each of the peer to peer bindings look like on the peers.</p>
  
  <pre><code>&lt;netPeerTcpBinding&gt;
      &lt;binding name="PeerTcpConfig" port="0"&gt;
        &lt;security mode="None"&gt;&lt;/security&gt;
        &lt;resolver mode="Custom"&gt;
          &lt;custom address="net.tcp://127.0.0.1/GlobalStoreAPIServer"  
              binding="netTcpBinding" bindingConfiguration="TcpConfig"&gt;
          &lt;/custom&gt;
        &lt;/resolver&gt;
      &lt;/binding&gt;
    &lt;/netPeerTcpBinding&gt;
  </code></pre>
  
  <p>So what that means is that my server has an endpoint at 'net.tcp://127.0.0.1/GlobalStoreAPIServer'</p>