The Ice Framework

Guides, examples, and reference for building distributed applications with Ice.

Ice is a complete RPC framework that helps you build networked applications with minimal effort.

  • Ice does the networking. It takes care of opening network connections, serializing and deserializing data for network transmission, and retrying failed connection attempts, so you can focus on your application logic.
  • Start with the Greeter Example. Writing a client-server application with Ice does not take much code. See for yourself!
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
Ice::CommunicatorPtr communicator =
Ice::initialize(argc, argv);
Ice::CommunicatorHolder holder{communicator};
VisitorCenter::GreeterPrx greeter{
communicator,
"greeter:tcp -h localhost -p 4061"};
string greeting = greeter.greet("alice");
cout << greeting << endl;
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
["cs:identifier:Greet"]
string greet(string name);
}
}
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("alice");
Console.WriteLine(greeting);
Greeter.ice
["java:identifier:com.example.visitorcenter"]
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
try (var communicator = new Communicator(args)) {
var greeter = GreeterPrx.createProxy(
communicator,
"greeter:tcp -h localhost -p 4061");
String greeting = greeter.greet("alice");
System.out.println(greeting);
}
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
client.js
await using communicator =
new Ice.Communicator(process.argv);
const greeter = new VisitorCenter.GreeterPrx(
communicator,
"greeter:tcp -h localhost -p 4061");
const greeting = await greeter.greet("alice");
console.log(greeting);
Greeter.ice
["matlab:identifier:visitorcenter"]
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
client.m
communicator = Ice.Communicator(args);
cleanup = onCleanup(@() communicator.destroy());
greeter = visitorcenter.GreeterPrx( ...
communicator, ...
'greeter:tcp -h localhost -p 4061');
greeting = greeter.greet('alice');
fprintf('%s\n', greeting);
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
Client.php
$communicator = Ice\initialize($argv);
$greeter =
VisitorCenter\GreeterPrxHelper::createProxy(
$communicator,
'greeter:tcp -h localhost -p 4061');
$greeting = $greeter->greet("alice");
echo "$greeting\n";
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
async with Ice.Communicator(
sys.argv, eventLoop=asyncio.get_running_loop()
) as communicator:
greeter = VisitorCenter.GreeterPrx(
communicator,
"greeter:tcp -h localhost -p 4061")
greeting = await greeter.greetAsync("alice")
print(greeting)
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
client.rb
Ice::initialize(ARGV) do |communicator|
greeter = VisitorCenter::GreeterPrx.new(
communicator,
"greeter:tcp -h localhost -p 4061")
greeting = greeter.greet("alice")
puts greeting
end
Greeter.ice
module VisitorCenter
{
/// Represents a simple greeter.
interface Greeter
{
/// Creates a personalized greeting.
string greet(string name);
}
}
var args = CommandLine.arguments
let communicator = try Ice.initialize(&args)
defer { communicator.destroy() }
let greeter = try makeProxy(
communicator: communicator,
proxyString:
"greeter:tcp -h localhost -p 4061",
type: GreeterPrx.self)
let greeting = try await greeter.greet("alice")
print(greeting)

The main chapters. Every chapter is in the table of contents; to find any page by name, use the search box in the top bar or press Ctrl+K, or ⌘K on macOS.