Network communication based on RMI/RPC between clients (nodes)
Any node can host own object to provide inside functions for all another nodes Also, node
s can subscribe on remote events
var spServer = new SpServer();
spServer.Initialize("127.0.0.1", 6669, 5, 15, 3);
var spClient = new SpClient(new TestHostedObject(), "someChannel"); //here we install self hosted object with shared function`s on channel
spClient.Connect("127.0.0.1", 6669);
spClient.Subscribe("testChannel" (action) =>
{
//event callback...
});
public class TestHostedObject
{
[SpMessage] //that attribute required for all shared function`s
public void Foo()
{
//foo callback...
}
}
var spClient = new SpClient();
spClient.Connect("127.0.0.1", 6669);
spClient.Publish("testChannel" /*some argumets here*/); //that callback will receive all subsribed clients on 'testChannel'
spClient.RemoteCall("someChannel", "Foo");
NLog, MessagePack serializer
Some parts used from NLC Framework (delegate serialization) NLC: https://github.com/ImVexed/NotLiteCode