IceRpc.Slice 0.1.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package IceRpc.Slice --version 0.1.0                
NuGet\Install-Package IceRpc.Slice -Version 0.1.0                
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.Slice" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IceRpc.Slice --version 0.1.0                
#r "nuget: IceRpc.Slice, 0.1.0"                
#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.Slice as a Cake Addin
#addin nuget:?package=IceRpc.Slice&version=0.1.0

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

IceRPC + Slice integration

The IceRPC framework allows you to make RPCs with the serialization format and IDL of your choice.

The IceRpc.Slice assembly is part of the IceRPC + Slice integration: it helps the Slice compiler for C# implement Slice interfaces and operations for use with IceRPC.

Package | Source code | Documentation | Examples | API reference

Sample Code

// Slice contract

module VisitorCenter

/// Represents a simple greeter.
interface Greeter {
    /// Creates a personalized greeting.
    /// @param name: The name of the person to greet.
    /// @returns: The greeting.
    greet(name: string) -> string
}
// Client application

using IceRpc;
using VisitorCenter;

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

// GreeterProxy is a struct generated by the Slice compiler; its implementation uses IceRpc.Slice.
var greeterProxy = new GreeterProxy(connection);
string greeting = await greeterProxy.GreetAsync(Environment.UserName);

Console.WriteLine(greeting);

await connection.ShutdownAsync();
// Server application

using IceRpc;
using IceRpc.Features;
using IceRpc.Slice;
using VisitorCenter;

await using var server = new Server(new Chatbot());
server.Listen();

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

// Class IceRpc.Slice.Service is an IceRPC dispatcher. This dispatch is implemented by Chatbot and helper code provided
// by the IGreeterService interface generated by the Slice compiler.
internal class Chatbot : Service, IGreeterService
{
    public ValueTask<string> GreetAsync(
        string name,
        IFeatureCollection features,
        CancellationToken cancellationToken)
    {
        Console.WriteLine($"Dispatching greet request {{ name = '{name}' }}");
        return new($"Hello, {name}!");
    }
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on IceRpc.Slice:

Package Downloads
IceRpc.Locator

Locator interceptor for IceRPC

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on IceRpc.Slice:

Repository Stars
icerpc/icerpc-csharp
A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
Version Downloads Last updated
0.4.0.1 118 9/17/2024
0.4.0 80 9/16/2024
0.3.1 1,070 3/28/2024
0.3.0 587 2/14/2024
0.2.1 533 12/12/2023
0.2.0 356 12/4/2023
0.1.2 335 10/9/2023
0.1.1 144 9/18/2023
0.1.0 160 9/6/2023