* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / sample / drb / namec.rb
blobf6db6f302219069e9835092c0cd868a74c0389ca
1 =begin
2  distributed Ruby --- NamedObject Sample Client
3         Copyright (c) 2000-2001 Masatoshi SEKI 
4 =end
6 require 'drb/drb'
8 begin
9   there = ARGV.shift || raise
10 rescue
11   puts "usage: #{$0} <server_uri>"
12   exit 1
13 end
15 DRb.start_service()
16 ro = DRbObject.new(nil, there)
18 seq = ro["seq"]
19 mutex = ro["mutex"]
21 p seq
22 p mutex
24 mutex.synchronize do
25   p seq.next_value
26   p seq.next_value
27 end
29 puts '[return] to continue'
30 gets
32 mutex.synchronize do
33   p seq.next_value
34   p seq.next_value
35 end