[REBOL] Re: [BUG?] read-io & write-io or Wait or is TCL better?
From: Rebolinth:nodep:dds:nl at: 24-Dec-2003 22:30
Quoting Andrew Martin <[andrew--martin--colenso--school--nz]>:
Hello Andrew,
Thanks for the tip but thats not the problem/solution, otherwise the other sessions
like telnet etc would have had problems too...also its binary data i transport
to keep it as clean as possible...
I realy dont have any clue what it can be, it realy looks like a bit/byte mixup
somwhere on the read-io or write-io... Im not missing bytes!! (i cheched it)
But it could be mixed around somewhere in the io-session...
Also im using open/binary/direct/no-wait on the ports,
So what Petr tells could be a clue?? I realy am speachless right now...
I just changed the port to open/direct/no-wait but then im realy having problems
because the port will be string based, which should not be, so thats not working
either..(also different errors occeur logicaly)...
Hope more clue's come in the mailinglist...
Thanks,
(R)egards,
Norman.
->
-> For 'read-io, the buffer size must be larger than the size of the data
-> coming in!
->
-> For example, in my Wiki (and Mesh) scripts, I use this:
-> Query_String: make string! 2 +
-> Length: to integer! Rebol/options/cgi/content-length
-> read-io Rebol/ports/input Query_String Length
->
-> I'd suggest you use something like:
->
-> buffer: make string! 2 + bufsize
-> while [ positive? size: read-io INCOMING buffer bufsize ] [
-> write-io OUTGOING size