#!/usr/local/bin/ruby
require 'web'

f = open('/home/moonwolf/public_html/cgi-bin/nora/sample/rinda/log/gateway.log','a')

api = Web::Interface::AUTO.new

f.puts "[#{Time.now.to_s}] " + api.inspect

gw  = Web::Interface::Rinda.new(:name => 'rindasample', :uri => 'druby://localhost:7650')

f.puts "[#{Time.now.to_s}] " + gw.inspect

while req = api.request
  f.puts ""
  f.puts "Request  [#{Time.now.to_s}] " + req.inspect
  rsp = gw.forward(req)
  f.puts "Response [#{Time.now.to_s}] " + rsp.inspect
  api.response req, rsp
end

f.close
