ZeroC.Ice
3.8.3
Prefix Reserved
dotnet add package ZeroC.Ice --version 3.8.3
NuGet\Install-Package ZeroC.Ice -Version 3.8.3
<PackageReference Include="ZeroC.Ice" Version="3.8.3" />
<PackageVersion Include="ZeroC.Ice" Version="3.8.3" />
<PackageReference Include="ZeroC.Ice" />
paket add ZeroC.Ice --version 3.8.3
#r "nuget: ZeroC.Ice, 3.8.3"
#:package ZeroC.Ice@3.8.3
#addin nuget:?package=ZeroC.Ice&version=3.8.3
#tool nuget:?package=ZeroC.Ice&version=3.8.3
Ice for C#
The Ice framework provides everything you need to build networked applications, including RPC, pub/sub, server deployment, and more.
Ice for C# is the C# (and .NET) implementation of the Ice framework. The ZeroC.Ice NuGet package provides the Ice assembly.
Package | Source code | Examples | Documentation | API reference
Sample Code
// Slice definitions (Greeter.ice)
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
/// @param name The name of the person to greet.
/// @return The greeting.
["cs:identifier:Greet"] // We prefer PascalCase for C# methods.
string greet(string name);
}
}
// Client application
using VisitorCenter;
await using var communicator = new Ice.Communicator(ref args);
GreeterPrx greeter = GreeterPrxHelper.createProxy(
communicator,
"greeter:tcp -h localhost -p 4061");
string greeting = await greeter.GreetAsync(Environment.UserName);
Console.WriteLine(greeting);
// Server application
await using var communicator = new Ice.Communicator(ref args);
Ice.ObjectAdapter adapter =
communicator.createObjectAdapterWithEndpoints("GreeterAdapter", "tcp -p 4061");
adapter.add(new Server.Chatbot(), new Ice.Identity { name = "greeter" });
adapter.activate();
Console.WriteLine("Listening on port 4061...");
Console.CancelKeyPress += (sender, eventArgs) =>
{
eventArgs.Cancel = true;
Console.WriteLine("Caught Ctrl+C, shutting down...");
communicator.shutdown();
};
await communicator.shutdownCompleted;
// Greeter implementation
using VisitorCenter;
namespace Server;
internal class Chatbot : GreeterDisp_
{
public override string Greet(string name, Ice.Current current)
{
Console.WriteLine($"Dispatching greet request {{ name = '{name}' }}");
return $"Hello, {name}!";
}
}
Protocol Compression
Ice for C# implements protocol compression with the native bzip2 library: bzip2.dll on Windows, libbz2.so.1 on
Linux, and libbz2.dylib on macOS. Ice loads this library dynamically at run time, so the library must be next to your
application or in a directory on the system library path (PATH on Windows). The ZeroC.Ice package does not bundle
this library.
Linux distributions and macOS provide bzip2. On Windows, bzip2.dll is available from the
ZeroC.Bzip2 NuGet package, the Ice for C++ NuGet package, and the Windows installer.
When Ice cannot load this library, Ice sends all messages uncompressed. If Ice receives a compressed message, it aborts
the connection: the sender gets a ConnectionLostException, and the receiver logs a warning when Ice.Warn.Connections
is enabled.
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on ZeroC.Ice:
| Package | Downloads |
|---|---|
|
ZeroC.Glacier2
Client library for the Glacier2 service |
|
|
ZeroC.IceStorm
Client library for the IceStorm service |
|
|
ZeroC.IceGrid
Client library for the IceGrid service |
|
|
ZeroC.IceBox
Client library for the IceBox service |
|
|
ZeroC.IceLocatorDiscovery
The IceLocatorDiscovery plug-in |
GitHub repositories
This package is not used by any popular GitHub repositories.