title: WCF IPv6 Endpoints
body: <p>I'm investigating the possibility of using the Peer 2 Peer along with WCF in a Windows app for an EPoS terminal.</p>
  
  <p>The app will sit on a number of PC's in a local network; there will only ever be one instance of the app per PC.</p>
  
  <p>My current thinking is that my app starts up and joins the peer mesh, on joining the mesh it periodically shouts out a 'heartbeat' message which contains its terminal id and IPv6 address.  </p>
  
  <p>Any other terminals joining the mesh receive these heartbeats and maintain their own list of terminals in the network.</p>
  
  <p>Actions within the app will require accessing a specific terminal on the network.  The app therefore resolves the terminal id to an ip address and can generate a Uri to access the service via net.tcp</p>
  
  <p>I have published the service endpoint using the link local address</p>
  
  <pre><code>printingHostRemote = New ServiceHost(printSpooler, New Uri("net.tcp://" &amp; myNetworkAddress &amp; "/" &amp; ServiceNames.PrintingService))
  printingHostRemote.AddServiceEndpoint(GetType(IPrintingService), tcpPipeBinding, "net.tcp://" &amp; myNetworkAddress &amp; "/" &amp; ServiceNames.PrintingService)
  </code></pre>
  
  <p>The string to setup the endpoint would be, for example:</p>
  
  <p>"net.tcp://[fe80::250:56ff:fec0:8%4]:5555/GSS-POS/PrintingService"</p>
  
  <p>However, when I try an access this service I get an error saying that the host is unreachable.</p>
  
  <p>TCP error code 10065: A socket operation was attempted to an unreachable host fe80::290:5ff:fe01:6303%4:5555</p>
  
  <p>I realise this is down to my limited knowledge of IPv6 addressing.  What address should I be using for my endpoint (I'm using the link local IPv6 address) ?  Or is my overall concept flawed?</p>
  
  <p>TIA, </p>
  
  <p>Simon</p>