AltME: R3 Protocols

Messages

GrahamC
Sorry, does the above work or not?
Rebolek
It sort of works. Request is send and response is read back but instead of returning immediately, it waits for timeout. The HTTP example from rebol.net wiki returns immediately.
GrahamC
read  [
                print ["Read" length? event/port/data "bytes"]
                read event/port
            ]
Here you need to print the event data and return true .. not read again
You are timing out because you are attempting to read again from the port when no more data is coming
Rebolek
So why does it work in HTTP example?
Also, changing the READ code to:
            read  [
                print ["Read" length? event/port/data "bytes"]
                true
            ]
does nothing. It still waits until timeout.
GrahamC
the http protocol uses two event engines .. it's complicated
Does it print any data?
Rebolek
yes, it prints instantly and then waits 10 seconds.
GrahamC
change that to . return true and not just true
you still have false at the end of your loop
Rebolek
Wow!
Oh, I see...
Thanks, Graham!
GrahamC
Or, restructure your loop the same way as I did
NP .. still waiting on text-table and text-list fixes :)
Rebolek
I know, I''m sorry...I'm spending too much time with Redis ;)
Bt with async (almost) working I guess I can move from it for some time and fix the styles :)
GrahamC
Anyway, I thought I explained this in my tutorial .. I need to look again to see what I wrote

Last message posted 486 weeks ago.