Firstly, excuse for my english, i’m a french student.
I develop a chat in ruby with DRB/Rinda and i use tuplespace but i don’t
understand how the tuplespaces work.
I have a server :
while true
#on lit le tuple
messlu_Server = tuple_space.take([:message,nil])[1]
tuple_space.write [:message,messlu_Server]
#on dort 1 seconde
sleep(1)
end
and a client:
who read the tuplescape with this line :
messlu = @ts.read([:message,nil])[1]
@buffer.set_text(messlu)
(I work with Glade 2 to build my program)
I have two questions :
How I can send more tuple in my tuplespace? Example : tuple_space.write
[:message,:id,messlu_Server,id] does not work
With my chat, messages are not synchronisez. client1 send a message, but
client2 does’nt receive the message and when client1 send an another
message, he read the last message. What’s the best solution…