polling only on socket, or can there be a trigger?
Mark Waddingham
mark at livecode.com
Sun May 10 06:43:50 EDT 2015
On 2015-05-10 02:13, Dr. Hawkins wrote:
> On Sat, May 9, 2015 at 12:03 PM, Mark Waddingham <mark at livecode.com>
> wrote:
>
> So where I really should be going then, is
>
> on newClient clAdr
> doSomeStuff
> read from socket clAdr with message "dhbkProcScktDat"
> end newClient
>
> on dhbkProcScktDat skt, msg
> doSomethingWith Data
> read from socket sckt with message "dhbkProcScktDat"
> end dhbkProcScktDat
>
> So that when it processes data, it puts itself back in place to do it
> again.
This is the correct form. Note there is no nesting here - the callback
message 'dhbkProcScktDat' will be sent as an engine event (just like
mouseUp) so can only happen when the current handler stack has finished
executing or the engine hits a 'wait with messages' command. i.e. the
callback message is sent in exactly the same way as a message 'sent in 0
ms'.
--
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
More information about the use-livecode
mailing list