libURL gone mad
Richard Gaskin
ambassador at fourthworld.com
Thu Sep 1 19:41:11 EDT 2016
Super-cool info, Charles! Thanks for taking the time to ponder my query.
Very much looking forward to v8.1rc2.
If you can make it to our local LiveCode User Group meeting tonight in
Pasadena I'll buy you dinner. If not, consider the offer open for
whenever we have a chance to meet in person.
Between now and the final release of v8.1 I have two apps that could
benefit from some reliable solution for this in v6.0 (long story as to
why, but that's where we are until we get to v8.1).
Anyone here know a way to prevent situations in which libURL has both
"it" and "the result" empty in v6?
Ancient history, I know, and soon behind me. But it'd be nice to have a
solution in hand to tide me over for these remaining weeks that I'm tied
to that old version.
--
Richard Gaskin
Fourth World Systems
Charles Warwick wrote:
> Hi Richard,
>
> I am keen to see as many of these issues resolved as possible, so please
> let me know if you have any more details for requests that don't seem to
> ever complete or error.
>
> By the sounds of it, you are using a commercial version of LC that
> includes tsNet and its libUrl wrapper.
>
> There are a number of fixes for tsNet that will be coming out in 8.1RC2
> when it is released (they did not quite make it into RC1).
>
> In particular, the "tsneterr: Sync request already in progress" should
> only be seen if you are calling the tsNet handlers directly, not if you
> are using libUrl. In RC2, you will only ever see the standard "Previous
> request not yet completed" error if you are using libUrl commands.
>
> It also has some improved request handling that will hopefully resolve
> some of issues with requests not completing properly.
>
> And in answer to your main question there.... this release will also
> include a new function tsNetIsSyncBlocked() that will do exactly what
> you want.
>
> This function will return true if an existing synchronous network
> request is in progress (libUrl commands like post x to url y, put url x
> into y, etc...) that will prevent another synchronous request from being
> initiated (async or non-blocking requests can still be made). Note that
> in the LC Business edition, multiple requests can be sent at the same
> time, so this will always return false.
>
> So, to rewrite the handler you have below, you will be able to simply do:
>
> on mouseUp
> if tsNetIsSyncBlocked() is true then
> beep
> else
> get url tURL
> if the result is empty then
> put it into image 1
> else
> answer the result
> end if
> end if
> end mouseUp
>
> Regards,
>
> Charles
More information about the use-livecode
mailing list