[REBOL] Re: Problem: Talking from Rebol to Rebol via socket
From: sqlab:gmx at: 23-Feb-2009 13:00
ok, the same example
with waiting for events and ping pong messages in a 10 sec forever
This you can do with many sockets too, but then it is more elegant to
use awake finctions.
listen: open/no-wait join tcp://: c-port
; wait until something happens
either same? listen connection: wait waitports [
print [tab "Connected"]
c-client: first connection
append waitports c-client
print [tab "Read message from c-side"]
msg: copy connection
either not msg [
print [tab "Closing socket"]
print [tab "Send answer to c-side"]
insert connection "r-side"
connection: open/no-wait tcp://localhost:12345
insert connection "r-side-client"
probe copy connection
Robert M. Münch wrote: