IceRpc 0.3.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package IceRpc --version 0.3.1
NuGet\Install-Package IceRpc -Version 0.3.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IceRpc" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IceRpc --version 0.3.1
#r "nuget: IceRpc, 0.3.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IceRpc as a Cake Addin
#addin nuget:?package=IceRpc&version=0.3.1

// Install IceRpc as a Cake Tool
#tool nuget:?package=IceRpc&version=0.3.1

IceRPC

IceRPC is a modular RPC framework that helps you build networked applications with minimal effort. The IceRpc assembly and package represent the base assembly and package for the C# implementation of IceRPC.

Package | Source code | Getting started | Examples | Documentation | API reference

Sample Code

// Client application

using GreeterCore; // for the StringCodec helper class
using IceRpc;

await using var connection = new ClientConnection(new Uri("icerpc://localhost"));

string greeting = await GreetAsync(Environment.UserName);
Console.WriteLine(greeting);

await connection.ShutdownAsync();

// Create the request to the greeter and then await and decode the response.
async Task<string> GreetAsync(string name)
{
    // Construct an outgoing request for the icerpc protocol.
    using var request = new OutgoingRequest(new ServiceAddress(Protocol.IceRpc))
    {
        Operation = "greet",
        Payload = StringCodec.EncodeString(name)
    };

    // Make the invocation: we send the request using the client connection and then wait
    // for the response. Since the client connection is not connected yet, this call also
    // connects it.
    IncomingResponse response = await connection.InvokeAsync(request);

    // When the response's status code is Ok, we decode its payload.
    if (response.StatusCode == StatusCode.Ok)
    {
        return await StringCodec.DecodePayloadStringAsync(response.Payload);
    }
    else
    {
        // Convert the response into a dispatch exception.
        throw new DispatchException(response.StatusCode, response.ErrorMessage);
    }
}
// Server application

using GreeterCore; // for the StringCodec helper class
using IceRpc;

// Create a server that will dispatch all requests to the same dispatcher, an instance of
// Chatbot.
await using var server = new Server(new Chatbot());
server.Listen();

// Wait until the console receives a Ctrl+C.
await CancelKeyPressed;
await server.ShutdownAsync();

internal class Chatbot : IDispatcher
{
    public async ValueTask<OutgoingResponse> DispatchAsync(
        IncomingRequest request,
        CancellationToken cancellationToken)
    {
        if (request.Operation == "greet")
        {
            string name = await StringCodec.DecodePayloadStringAsync(request.Payload);
            Console.WriteLine($"Dispatching greet request {{ name = '{name}' }}");

            return new OutgoingResponse(request)
            {
                Payload = StringCodec.EncodeString($"Hello, {name}!")
            };
        }
        else
        {
            // We only implement greet.
            return new OutgoingResponse(request, StatusCode.NotImplemented);
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (13)

Showing the top 5 NuGet packages that depend on IceRpc:

Package Downloads
IceRpc.Slice The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

IceRpc.Slice for C#.

IceRpc.Deadline The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Deadline interceptor and middleware for IceRPC

IceRpc.Logger The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Logger interceptor and middleware for IceRPC

IceRpc.Extensions.DependencyInjection The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Dependency injection extensions for IceRPC

IceRpc.Transports.Quic The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

QUIC transport for IceRPC

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.1 433 3/28/2024
0.3.0 689 2/14/2024
0.2.1 583 12/12/2023
0.2.0 397 12/4/2023
0.1.2 414 10/9/2023
0.1.1 253 9/18/2023
0.1.0 287 9/6/2023