>From REBOL/Command 2.5.6.3.1 console... >> loop 10 [get-fast urls] www.microsoft.com www.microsoft.com www.microsoft.com www.microsoft.com www.rebol.net ** Access Error: Port none not open ** Where: get-fast ** Near: res: res or async/awake async
>From REBOL/Link 1.0.5.3.1 console... >> loop 10 [get-fast urls] www.rebol.net ** Access Error: Port none not open ** Where: get-fast ** Near: either error? err: try [read-io port data max-transfer] >From REBOL/View 1.2.5.3.1 console... >> loop 10 [get-fast urls] www.rebol.net www.microsoft.com ** Access Error: Port none not open ** Where: get-fast ** Near: either error? err: try [read-io port data max-transfer] What's up with that? Enjoy!! ~~Ammon ;~> ----- Original Message ----- From: "Will Arp" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 04, 2004 7:52 AM Subject: [REBOL] /core async example > > ;copy-paste this in console and you'll see who is faster! > ;thanks to Gabriele, Marteen, Romano and Carl 8) > > do http://www.rebol.it/giesse/async-protocol.r > > get-fast: func [hosts /local port][ > foreach host hosts [ > uri: host > port: open rejoin [async:// host ":80"] > port/awake: do compose/deep handler > ] > until [wait .1 empty? system/ports/wait-list] > ] > > handler: [ > func [port [port!] state [word! error!]] [ > if error? :state [print mold disarm state return true] > switch state [ > connect [ > insert port rejoin [ > {GET / HTTP/1.0} crlf {Host: } (uri) crlf crlf] > false > ] > read [false] > write [false] > close [ > data: copy port > ;close port > clear system/ports/wait-list > print (uri) > ;print find data join crlf crlf > ;data: find/tail data join crlf crlf > true > ] > ] > ] > ] > > ;example > > urls: [ > "www.rebol.com" > "www.rebol.net" > "www.rebol.org" > "www.apple.com" > "www.oracle.com" > "www.microsoft.com" > ] > > loop 10 [get-fast urls] > > -- > To unsubscribe from this list, just send an email to > [EMAIL PROTECTED] with unsubscribe as the subject. > > > > -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.
