[REBOL] Re: No-wait
From: andreas:bolka:gmx at: 23-Feb-2004 18:43
Monday, February 23, 2004, 4:31:01 AM, Paul wrote:
> Even that still blocks. Need a way of not waiting for the port data
> if nothing is there.
But here, only the "accept" (i.e. the wait on the listen port) blocks.
You can overcome this by adding a "timeout":
port: open/direct/no-wait tcp://:7000
x: 0
forever [
print x + 1
x: x + 1
if not none? tmp: wait reduce [ port 0.02 ] [
data: first tmp
; data is bound to a "client" port
]
]
--
Best regards,
Andreas