In this case, It seems like I get the "dns success" message but that's
about it.

How should I be accessing this through the client. I am simply opening
up a rebol session and trying.

Testport: open/lines tcp://localhost:9000
Insert a "Hello World"=20

I have also tried

Do %atcp-protocol.r
Testport: open/lines atcp://localhost:9000
Insert a "Hello World"


Thanks
Charlie




port: open/lines/custom atcp://localhost:9000 [
    awake [
        foreach event port/locals/events [
            either error? event [
                close port ;close the atcp port
                return true ;stop wait
            ][
                switch/default event [
                    dns-failure [
                        close port ;close the atcp port
                        print "Cannot resolve the server name"
                        return true ;stop wait
                    ]
                    dns [
                        print ["dns success:" port/host "=3D"
port/sub-port/port-id]
                    ]
                    max-retry [
                        close port ;close the atcp port
                        print "Can't connect to server"
                        return true ;stop wait
                    ]
                    connect [
                        print "Ok, connected"
                        insert port "Hello world!"
                    ]
                    read [
                        print ["Data read:" copy port]
                    ]
                    write [
                        print "All data has been written"
                    ]
                    close [
                        print "Peer closed the connection."
                        close port  ;close the atcp port
                        return true ;stop wait
                    ]
                ][
                    print "Unexpected event - should not happen"
                    close port
                    return true ;stop wait
                ]
            ]
        ]
        false ;continue wait
    ]
]
wait-start port
wait-list?
forever [ wait [] ]

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Peter WA Wood
Sent: Saturday, November 13, 2004 9:56 AM
To: [EMAIL PROTECTED]
Subject: [REBOL] Re: Async Question


Anton

Thanks for the neat summary.

Is there a "to" missing between was and provide in the following =20
sentence ?

The reason Rebol Technologies finally added this was provide a standard

async root-protocol.

Regards

Peter

On Saturday, Nov 13, 2004, at 22:45 Asia/Kuala_Lumpur, Anton Rolls =20
wrote:

>
> This document (composed tonight) might help you
> to make a decision:
>
> http://www.lexicon.net/antonr/rebol/doc/ASYNC-The-available-=20
> implementations.
> txt
>
> Anton.
>
>> Wardell, Charles  wrote.. apparently on 12-Nov-2004/13:17:51-5:00
>>> Can someone give me an example of how to use the async-protocol.r
>>> I did not find any documentation other then the comments in the .r =20
>>> file.
>>>
>>
>> http://www.compkarori.com/vanilla/display/async-tutorial
>>
>> --
>> Graham Chiu
>
> --=20
> To unsubscribe from the list, just send an email to rebol-request
> at rebol.com with unsubscribe as the subject.
>
>
>

--=20
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.


-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to