Hello [EMAIL PROTECTED]!

On 25-Ago-00, you wrote:

 p> Could you be more specific, please? How do you want to
 p> substitute read-io read-by-buffer-size-parts functionality?

You need to use READ-IO when you a) want the raw data and b) don't
want to wait for the remote part to close the port. COPY/PART had
a similar functionality on /BINARY TCP ports, but it still waited
if there were no data in the port. Now you can just use COPY or
COPY/PART, because it no more waits for data. 

Imagine a client-server communication. With the new experimental
core:

Asynchronous communication:

Server:
>> listen: open tcp://:10000
>> conn: first listen

Client:
>> conn: open tcp://localhost:10000
>> insert conn "hello server!"

Server:
>> copy conn
== "hello server!"
>> insert conn "hello client!"

Client:
>> copy conn
== "hello client!"

and so on.

Synchronous communication:

Server:
>> listen: open/wait tcp://:10000
>> conn: first listen            

Client:
>> conn: open tcp://localhost:10000
>> insert conn "1234567890"

Server:
>> copy/part conn 20
(waits...)

Client:
>> insert conn "1234567890"

Server:
(ends waiting)
== "12345678901234567890"

You don't even need to use a cycle if you use syncronous
operations (which you can use if you don't need to handle
multiple connections or other events).

Regards,
    Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

Reply via email to