Read from socket async?
David Vaughan
drvaughan55 at mac.com
Sun Feb 10 07:03:01 EST 2002
Dave
My test and conclusions are valid. Their implication and result is that
the line I highlighted in your script below will cause your repeat loop
NEVER to terminate. You see, the message(s) "dataAdded" are only queued
by the read handler, not executed until the entire mouseUp completes. My
own script also queues messages in the same way, but completes, after
which all the queued messages (one for each read with data) are then
successively run.
This, of course, is Gary's problem as well. How to write an efficient
input loop which can receive data fast, process it, and do so in the
background so it will also respond to user commands (I presume).
regards
David
>
snip
> on mouseUp
> global sname
> put zero into lcounter
> repeat 10
> read from socket sname until return with message "dataAdded"
> add 1 to lcounter
> wait until lcCounter = (lcCounter -1) with messages ##this is the
> block
> put lcounter into field "f2"
> end repeat
> end mouseUp
>
snip
>
> Cheers
> Dave Cragg
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1279 bytes
Desc: not available
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20020210/8c220a4e/attachment-0001.bin>
More information about the use-livecode
mailing list