Ice for Ruby
Examples | Documentation | Building from source
The Ice framework provides everything you need to build networked applications, including RPC, pub/sub, server deployment, and more.
Ice for Ruby is the Ruby implementation of the Ice framework. As of this version, it supports only clients: you need to implement the server portion of your application in another programming language such as C++, C# or Java.
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.
string greet(string name);
}
}
# Client application (client.rb)
require 'etc'
require 'Ice'
require_relative 'Greeter.rb'
Ice::initialize(ARGV) do |communicator|
greeter = VisitorCenter::GreeterPrx.new(communicator, "greeter:tcp -h hello.zeroc.com -p 4061")
greeting = greeter.greet(Etc.getlogin)
puts greeting
end