[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-11 Thread Coussement Christophe
Hi Maarten, It's all clear now ;) Thanks ! ==christophe > > > The specific example you try is a client that connects to a > webserver to > fetch the image. If you have no webserver running (no valid > url...): no > image! > > async:// is just like tcp:// , but now with calllbacks instead

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-11 Thread Maarten Koopmans
The specific example you try is a client that connects to a webserver to fetch the image. If you have no webserver running (no valid url...): no image! async:// is just like tcp:// , but now with calllbacks instead of waiting yourself. Does this help you? --Maarten Coussement Christophe wrot

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-11 Thread Coussement Christophe
Hi Maarten and Will Sorry for this late answer: I was out of office for a while... Thanks for helping me ! > >I tried the following, but without any result. I try to load > a %logo.jpg file situated in the same dir as %async-protocol, > and try to connect to localhost. What did I wrong? > > >

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Gabriele Santilli
Hi Maarten, On Thursday, March 4, 2004, 12:44:17 PM, you wrote: MK> Yes, but you need to do that once, that will trigger the 'write vent MK> that can take over. Typically I insert the first few chars of an out buffer. It is also possible to insert a big string all at a time (after read or

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Maarten Koopmans
Hi Christophe, >I do not have very much experience when coming to network protocol, so please excuse >the triviality of my question :). >The fact is I could for sure use this 'async protocol for a project we are now >developing. > > Good. >I tried the following, but without any result. I try

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Will Arp
I think you need a slash before "logo.jpg" and a space after "Host:" -> insert port {GET /logo.jpg HTTP/1.0^M^JHost: 127.0.0.1^M^J^M^J} On 4 mar 2004, at 15:11, Coussement Christophe wrote: > insert port {GET logo.jpg HTTP/1.0^M^JHost:127.0.0.1^M^J^M^J} Will -- To unsubscribe from this list,

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Coussement Christophe
Hi Maarten, I do not have very much experience when coming to network protocol, so please excuse the triviality of my question :). The fact is I could for sure use this 'async protocol for a project we are now developing. I tried the following, but without any result. I try to load a %dghr.jpg

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Maarten Koopmans
Terry Brownell wrote: >ok, in answer to my own question, you can use "insert port" at anytime >while processing script. > >TB > >Terry Brownell wrote: > > > Yes, but you need to do that once, that will trigger the 'write vent that can take over. Typically I insert the first few chars of an ou

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Maarten Koopmans
Terry Brownell wrote: >Using the server example in the doc, the server stops once the client >disconnects? > >Terry > > No, it closes the connection with this particular client only. --Maarten -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the s

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Terry Brownell
ok, in answer to my own question, you can use "insert port" at anytime while processing script. TB Terry Brownell wrote: >I was misunderstood.. what I meant was, once I get some stuff FROM read.. and >do some magic with it (ie: get the result of 2 + 2).. how do I send the RESULT >back to the

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Terry Brownell
Using the server example in the doc, the server stops once the client disconnects? Terry -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Terry Brownell
I was misunderstood.. what I meant was, once I get some stuff FROM read.. and do some magic with it (ie: get the result of 2 + 2).. how do I send the RESULT back to the client via WRITE? I dont have a problem with getting or processing READ. Terry Terry Brownell wrote: >Excellent.. finally s

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Maarten Koopmans
add a false after the read code :-) Terry Brownell wrote: >Excellent.. finally some light in this dark hole of tcp. > >I have a couple of questions though.. in the handler we have connect, >read, write close.. how can i do this... > >connect [] >read [ (read the buffer, which in this case is "

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Maarten Koopmans
Terry Brownell wrote: >Excellent.. finally some light in this dark hole of tcp. > >I have a couple of questions though.. in the handler we have connect, >read, write close.. how can i do this... > >connect [] >read [ (read the buffer, which in this case is "2 + 2", and having >processed this t

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-04 Thread Terry Brownell
Excellent.. finally some light in this dark hole of tcp. I have a couple of questions though.. in the handler we have connect, read, write close.. how can i do this... connect [] read [ (read the buffer, which in this case is "2 + 2", and having processed this to a result string of "4"...)] w

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Ashley TrĂ¼ter
Well done guys, and thanks for taking the time and effort to not only release this but *explain* it! ;) Regards, Ashley -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Maxim Olivier-Adlhoch
> Subject: [REBOL] Re: The REBOL async:// tutorial - take 1 > > > > First, realize that we didn't knock this off in two > afternoons. So it is > OK to hit your head against the wall. > > >> handler: func [port [port!] state [word! error!] /local tmp cmd]

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Gabriele Santilli
Hi Maarten, On Wednesday, March 3, 2004, 7:35:46 PM, you wrote: >>> either error? try [listen: open/no-wait tcp://:8000] [ >>> port: open async://localhost:8000 >>> port/awake: do handler >>> >>> >>> >>> >>Above code somehow escapes my understanding :-) So if we are not able to >>op

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Paul Tretter
Thanks Maarten and Gabriele! Paul Tretter - Original Message - From: "Maarten Koopmans" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 03, 2004 8:48 AM Subject: [REBOL] The REBOL async:// tutorial - take 1 > > See below. Enjoy it. Republish it. > ==

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Maarten Koopmans
First, realize that we didn't knock this off in two afternoons. So it is OK to hit your head against the wall. >> handler: func [port [port!] state [word! error!] /local tmp cmd] [ >> if error? :state [print mold disarm state return true] >> switch state [ >> connect [ >>

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Petr Krenzelok
Maarten Koopmans napsal(a): Hi, that stuff looks really excelent! Strange thing is, that even if the code looks pretty straightforward, I don't understand every detail of it, but that is what there are questions for :-) > handler: func [port [port!] state [word! error!] /local tmp cmd] [ >

[REBOL] Re: The REBOL async:// tutorial - take 1

2004-03-03 Thread Maarten Koopmans
Of course you have to do the async-protocol.r first before trying the sample code. Maarten Koopmans wrote: >See below. Enjoy it. Republish it. >== > >The REBOL async:// tutorial - Take 1 > >Maarten Koopmans, code samples and root protocol by G