IceRpc.Slice
0.1.2
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package IceRpc.Slice --version 0.1.2
NuGet\Install-Package IceRpc.Slice -Version 0.1.2
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.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IceRpc.Slice --version 0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IceRpc.Slice, 0.1.2"
#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.2 // Install IceRpc.Slice as a Cake Tool #tool nuget:?package=IceRpc.Slice&version=0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
net7.0
- IceRpc (= 0.1.2)
- ZeroC.Slice (= 0.1.2)
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.
|