AltME: R3 Protocols


First 5 minutes of testing shows that in  the new release, the tls port is now more like the tcp port

Could use R2 probably, but - can R3 read ftp? I will soon need small script for my LED screen client, who requests placing commercials himself. So my idea is to allow them to place it to FTP server, then my script takes it, downloads it, and rewrites the file locally ...
There's no ftp protocol built into R3, and I haven't heard of anyone making one. Maybe Kaj's curl wrapper can do ftp.
When I look at dev-net.c source it seems like UDP is only one switch. Would it be the UDP actor the same as for TCP or may it be less complicated?
The cURL binding can do FTP, of course
We've been uploading our websites with it for several years
I wrote a ftp scheme three years ago ... and was able to download ISO images with it.
Pekr, you forget so quickly!
As do I :)
to sys/make-scheme
and it should work. I did test it a week ago to confirm this.
Graham - I do remember VERY well in fact :-) But I was not sure it is recent and working with latest R3 releases. I would really like R3 to accept some protocols as standard ...
the work I was doing recently was turning these old efforts into synchronous forms as in R2
I have this unanswered question on how to deal with network timeouts
that I need answered.  I'd like some automatic way for tcp to update the waitlist somehow so that if network activity is occuring, the port should not timeout.
any takers?
In R2 you just increase the system timeout value prior to starting your network call
Does everyone remember the old spinning text with network activity from Rebol1 ?
IIRC you can still do it in R2.

I have troubles using async mode on schemes. I have my awake handler and I return TRUE on 'read event, but the WAIT doesn't return and waits until timeout. Any ideas what am I doing wrong?
can you break it down into the smallest example?  AFAIK, true at the end of the event loop should cause you to leave it
This should be it. It waits until timeout and then returns data:
send-redis-request: func [port] [
    write port #{2A330D0A24330D0A5345540D0A24390D0A6173796E63746573740D0A24340D0A747275650D0A}
read-redis: func [
    "Async HTTP reader"
    url [url!]
    /local spec port
    spec: probe decode-url url
    spec/2: to-lit-word 'tcp
    port: open spec
    port/awake: func [event] [
        ;print ["Awake-event:" event/type]
        switch/default event/type [
            lookup [open event/port]
            connect [send-redis-request event/port]
            wrote [read event/port]
            read  [
                print ["Read" length? event/port/data "bytes"]
                read event/port
            close [return true]
        ] [
            print ["Unexpected event:" event/type]
            close event/port
            return true
        false ; returned
print "REDIS reading..."
rp: read-redis tcp://
wait [rp 10]
close rp
print to-string rp/data

Last message posted 146 weeks ago.