A simple, hackable, remote code hosting platform.
NLC (Not Lite Code) is a simplified version of LiteCode by DragonHunter, which provides native RPC and other useful features without any external dependencies.
Traditionally RPC/RMI implements a stub interface and is tightly coupled. NLC however can function without a stub interface by using BinaryFormatter to serialize & deserialize objects on the fly at runtime allowing it to be loosly coupled. NLC also allows communication over SSLStream for security.
NLC creates a unique instance for every client allowing you to keep stateful data alongside their functions in the SharedClass.
As of 1.4 NLC's networking core is now asynchronous and will invoke calls in a new Task once the data is received. Thus any synchronization must either be ensured in the client invoking the methods or inside the SharedClass functions themselves.
SharedClass.cs
[NLCCall("MagicNumber")]publicboolIsMagicNumber(intnumber){returnnumber==7;}Program.cs
server=newServer<SharedClass>();server.Start();Program.cs
publicstaticasyncTask<bool>IsMagicNumber(intnumber)=>awaitclient.RemoteCall<bool>("MagicNumber",number);client=newClient();client.Connect("localhost",1337);Console.WriteLine(awaitIsMagicNumber(-10));// FalseConsole.WriteLine(awaitIsMagicNumber(7));// TrueLiteCode by DragonHunter
