Skip to content

Instantly share code, notes, and snippets.

@earl
Created August 31, 2013 22:20
Show Gist options
  • Save earl/39435a2f120cbbd63673 to your computer and use it in GitHub Desktop.
Save earl/39435a2f120cbbd63673 to your computer and use it in GitHub Desktop.
rebol [title: "#9910 Crash Demo" author: 'abolka date: 2013-08-31]
do-download: closure [url /local port] [
port: make port! url
port/awake: funct [event] [
switch probe event/type [
connect [
;; Use HTTP's READ actor to send the HTTP request once we are
;; connected.
read event/port
]
read [
;; Schedule the low-level TCP port for further reading.
;; (@@ Smells! Should be taken care of by the HTTP scheme.)
read event/port/state/connection
]
done [
;; Use HTTP's COPY actor to read the full website content once
;; reading is finished. (But throw away the data immediately.)
copy event/port
close event/port
return true
]
]
false
]
open port
port
]
loop 1000 [do-download to-url first system/options/args]
wait 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment