title: How should I implement a distributed Remote Method Invocation system in .NET?
body: <h2>Original Post</h2>
  
  <p>How would I implement a distributed Remote Method Invocation system?</p>
  
  <p>I'm trying to create something like the following:</p>
  
  <ul>
  <li>Master Server to track individual "hosts".</li>
  <li>Hosts can communicate with other hosts on the network using a proxy-object-interface based programming style, example: <code>var result = remoteHost.MyMethod(5);</code></li>
  </ul>
  
  <p>I've tried using RMI libraries like <a href="http://www.codeproject.com/Articles/105799/The-Super-Pool-Framework" rel="nofollow noreferrer">SuperPool</a> and <a href="http://www.codeproject.com/Articles/155282/A-Complete-TCP-Server-Client-Communication-and-RMI" rel="nofollow noreferrer">Scs</a>, however they have a few fundamental issues:</p>
  
  <ul>
  <li>SCS Supports only Server --> Client or Client --> Server communication, no Client --> Client communication.</li>
  <li>As far as I can tell, SuperPool only supports the same, although this picture would suggest otherwise, I cannot find anything in the documentation on how to do this:
  <img src="https://i.stack.imgur.com/01Ref.png" alt="enter image description here"></li>
  </ul>
  
  <p>The difference would be that <strong>any component on clients can also communicate with components on other clients, as opposed to only client-->server or server-->client communication.</strong></p>
  
  <p>How would you suggest I implement this (perhaps using these existing solutions as a base), or is there some other existing solution that might work?</p>
  
  <h2>More Extensive Example</h2>
  
  <p>Here is a diagram of what I'm trying to do:
  <img src="https://i.stack.imgur.com/2qSka.png" alt="enter image description here"></p>
  
  <p><sub><strong>IMPORTANT NOTE:</strong> Clients do NOT connect to each other.</sub></p>
  
  <p>Process:</p>
  
  <ol>
  <li>Client1 connects to Server</li>
  <li>Client2 connects to Server</li>
  <li>Client1 invokes a method on Client2, without knowing if the component of Client2 exists on the Server, another Client, or itself.</li>
  </ol>
  
  <p>The idea is the same as what SuperPool has done, except allowing the Client --> Server --> Client communication path for invoking a method on the second client.</p>