Skip to content

furesoft/Furesoft.Rpc.MMF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Furesoft.Rpc.MMF

A RPC Framework for IPC with Memory Mapped Files

Example: Interface:

public interface IMath {
     int Add(int x, int y);
     object MethodWithException();
     object this[int index] {get;set;}
}

Interface Implementation in Server:

public class MathImpl : IMath {
     public int Add(int x, int y) {
         return x + y;
     }
     
     public object MethodWithException() {
          return new Exception("Exception was trown");
     }
     
     int mul = 1;
     public int this[int index] {
          get {
               return index * mul;
          }
          set {
                mul = index + value;
          }
     }
}

Client:

using Furesoft.Rpc.MMF

public class Program {
      public static void Main() {
          var rpc = new RpcClient("ExampleChannel");
          rpc.Start();
          
          var math = rpc.Bind<IMath>();
          
          Console.WriteLine(math.Add(10, 5);
          math[15] = 22;
          
          Console.WriteLine(math[15]);
          
          math.MethodWithException();
      }
}

Server

using Furesoft.Rpc.MMF

public class Program {
      public static void Main() {
          var rpc = new RpcServer("ExampleChannel");
             
          rpc.Bind<IMath>(new MathImpl());
          rpc.Start();
      }
}

About

A RPC Framework for IPC with Memory Mapped Files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages