[REBOL] no-wait for scheme
From: patrick:philipot:laposte at: 18-Aug-2003 9:45
Previously on "Understanding tcp"
My previous problem, while trying to code a Rebol Client, was that 'copy
never returned any value.
>> serv: open/binary tcp://localhost:3000
>> insert serv "^(05)^(00)^(0A)^(00)^(00)^(01)DSN=mytest;"
>> insert serv "^(05)^(00)^(17)^(00)^(00)^(02)SELECT * from
>> insert serv "^(05)^(00)^(0B)^(00)^(00)^(06)FetchRecord"
>> copy serv
** Access Error: Network timeout
** Near: copy serv
>> close serv
Thanks to Maarten, Gabriele, and Norman, it is working now.
The /no-wait refinement was needed in my case.
My problem now is to use no-wait in a 'scheme.
The scheme is very short:
make root-protocol [
open: func [port [port!] /local connection-string][
port/sub-port/state/flags: 524835 ; force /direct/binary mode
if not none? port/target [ append connection-string join "DSN="
port/target ";" ] ]
if not none? port/user [ append connection-string join "UID="
port/user ";" ] ]
if not none? port/pass [ append connection-string join "PWD="
port/pass ";" ] ]
insert port connection-string
insert: function [ port data ] [ ] [
system/words/insert port/sub-port data
copy: func [ port ] [
make string! system/words/copy port/sub-port
net-utils/net-install dbtcp self 3000
The test program is very short too.
db: open dbtcp://localhost/mytest
insert db rejoin ["^(05)^(00)^(17)^(00)^(00)^(02)" "select * from mytable"
insert db "^(05)^(00)^(0B)^(00)^(00)^(06)FetchRecord"
print mold copy db ; <<<<<<<<<<<<<< TIMEOUT ERROR
I can tell that all this work pretty well because tcpview shows a correct
trace. The server is receiving and sending its data.
However, as before, I am not in no-wait mode. And so the copy fails.
I have looked deeply in the code of all existing protocols but found
Does anybody have a clue?