AltME: R3 Protocols


For example, in the HTTP scheme, in the 'read event I call the check-response function, which determines if more data is needed (do we have all the headers? do we need content data? etc.) and calls READ on the port accordingly.
actually, I think that returning TRUE from the 'read event means "we are done, no more data to read", which signals the higher level READ to return your data. But, I might be wrong here, I don't remember the details.
Ah, OK, so calling READ from READ. I will try that. Thanks.
Yes, I think Gabriele is need to call READ action from READ event. AFAIK you can also WRITE on port from READ event to send some data to server if necessary...etc.  It depends on the protocol spec/logic you need to follow.

GrahamC: I was trying to use your excellent FTP protocol for R3 from, but I am getting an error when I am trying to read or load:
>> read
** Script error: cannot access state in path port/state/connection
** Where: read
** Near: read
>> load
** Script error: cannot access state in path port/state/connection
** Where: read either read-decode case load
** Near: read source if find system/options/file-types type [data: de...
I was wondering if this is a known issue or a regression?
The same port/state/connection error shows up when trying to write a file as well.
This is with the latest Windows build downloaded today from
Bo, you need to use the FTP protocol commands to read or save (you can't do it directly with 'read, 'write, 'load, etc.).  There are some working examples at and
Ah, thanks for that, Nick!
Yes, synchronous mode working on a url is not currently supported.  You need to work with a port!
Never got round to finishing the protocol.
There was no interest in 2010 lol
But I think it's easy enough to wrap them into a synchronous function

Getting an eror trying to open ftp port using prot-ftp.r
cmd: open decode-url
Script error: net-log has no value
Where: open
doesn't use 'decode-url
Will try again Graham, Thanks. I was working from NIck's tutorial...

Graham, similar error.
cmd: open
Script error: net-log word is not bound to a context
Where: open
I'm doing: do prot-ftp.r or is it a module that should be included in needs[]: ?
Not up to speed with R3...
Looks like module handling has changed since I wrote this.
Bo has been using this ... Bo?
Just tried it and I don't get that error.  Are you using latest rebol3 ?

  Platform:  Windows win32-x86
  Build:     14-Aug-2013/14:51:03
>> do %prot-ftp.r
>> cmd: open
port opened ...

Last message posted 185 weeks ago.