All Projects → PomeloFoundation → Pomelo.Net.Pomelium

PomeloFoundation / Pomelo.Net.Pomelium

Licence: MIT License
A light-weight RPC service build on .NET Core

Programming Languages

C#
18002 projects
powershell
5483 projects
shell
77523 projects
Batchfile
5799 projects

Pomelium

Pomelium is a light weight RPC library on which based .NET Core and TCP makes developers are able to invoke remote methods. It even contains session functions which similar to the web development. Developers could build their projects neatly.

The following sample is showing you how to use Pomelium

Server side:

public class Program 
{
    public static void Main(string[] args)
    {
        var server = PomeliumServer.CreateServer();
        server.OnConnectedEvents += Server_OnConnectedEvents;
        server.OnDisconnectedEvents += Server_OnDisconnectedEvents;
        server.Start("127.0.0.1", 6000);
        Console.Read();
    }

    private static void Server_OnDisconnectedEvents(Server.Client.LocalClient obj)
    {
        Console.WriteLine(obj.SessionId + " Disconnected");
    }

    private static void Server_OnConnectedEvents(Server.Client.LocalClient obj)
    {
        Console.WriteLine(obj.SessionId + " Connected");
    }
}

public class TestHub : PomeliumHub
{
    public int TestMethod(int a, int b)
    {
        return a + b;
    }
}

Client side:

public static void Main(string[] args)
{
    Test().Wait();
    Console.Read();
}

public static async Task Test()
{
    var client = new PomeliumClient();
    await client.ConnectAsync("127.0.0.1", 6000);
    var ret = await client.Server["Test"].TestMethod(1, 1);
    Console.WriteLine(ret);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].