Mastering TS Net

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Mastering TS Net

Niggemann, Bernd via use-livecode
I really need to get my head around TSNet, so began experiments.

This is the documentation for tsNetGetFile

" local tHeaders, tResult

put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
"ftp://user:[hidden email]/file.dat", tHeaders, \
"transferComplete") into tResult

on transferComplete pID, pResult, pBytes, pCurlCode
        local tData, tHeaders
        if pCurlCode is not 0 then
                answer tsNetRetrError(pID)
        else
        a nswer "File has been downloaded"
        end if
        tsNetCloseConn pID
end transferComplete

# but my first attempt to "get it" ... ran into this error.

Are there any good lessons on all TSNet functions?
 I am not looking forward to wading into this blind as a bat.

# variable watcher

tResult      --        tsneterr: ID already in use

what is strange is this, the IDE gives the error even before tracing the mouseup.

So I did not even get off home plate.

############
local tHeaders, tResult

on mouseup
# put a break here... the IDE show an error *before* stepping into the next statement
# I can't even close the connection with:
   tsNetCloseConn "1"
   put empty into tResult
   put fld aURL into pURL
   put empty into fld "fldHTTPHeader"
   put empty  into fld "tHTMLfield"
   set the itemDel to "/"
   put item -1 of pURL into tFileName
   put ("~/Desktop/"&tFileName) into tLocalFile
   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete") into tResult
 
   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
end mouseup

on transferComplete pID, pResult, pBytes, pCurlCode
   if pCurlCode is not 0 then
      answer tsNetRetrError(pID)
   else
      answer "File has been downloaded"
      put tHeaders into fld "fldHTTPHeader"
   end if
   tsNetCloseConn pID
end transferComplete

BR


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
Does TSNet even work with local files? For local files use the read/write
commands or "get/put url".

With a commercial license you shouldn't need to deal with the lower level
functions for internet communication. The basic put, post, and get commands
should do it.

--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On July 1, 2018 10:21:38 AM Sannyasin Brahmanathaswami via use-livecode
<[hidden email]> wrote:

> I really need to get my head around TSNet, so began experiments.
>
> This is the documentation for tsNetGetFile
>
> " local tHeaders, tResult
>
> put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
> "ftp://user:[hidden email]/file.dat", tHeaders, \
> "transferComplete") into tResult
>
> on transferComplete pID, pResult, pBytes, pCurlCode
> local tData, tHeaders
> if pCurlCode is not 0 then
> answer tsNetRetrError(pID)
> else
> a nswer "File has been downloaded"
> end if
> tsNetCloseConn pID
> end transferComplete
>
> # but my first attempt to "get it" ... ran into this error.
>
> Are there any good lessons on all TSNet functions?
> I am not looking forward to wading into this blind as a bat.
>
> # variable watcher
>
> tResult      --        tsneterr: ID already in use
>
> what is strange is this, the IDE gives the error even before tracing the
> mouseup.
>
> So I did not even get off home plate.
>
> ############
> local tHeaders, tResult
>
> on mouseup
> # put a break here... the IDE show an error *before* stepping into the next
> statement
> # I can't even close the connection with:
>   tsNetCloseConn "1"
>   put empty into tResult
>   put fld aURL into pURL
>   put empty into fld "fldHTTPHeader"
>   put empty  into fld "tHTMLfield"
>   set the itemDel to "/"
>   put item -1 of pURL into tFileName
>   put ("~/Desktop/"&tFileName) into tLocalFile
>   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete") into tResult
>
>   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
> end mouseup
>
> on transferComplete pID, pResult, pBytes, pCurlCode
>   if pCurlCode is not 0 then
>      answer tsNetRetrError(pID)
>   else
>      answer "File has been downloaded"
>      put tHeaders into fld "fldHTTPHeader"
>   end if
>   tsNetCloseConn pID
> end transferComplete
>
> BR
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
In reply to this post by Niggemann, Bernd via use-livecode
Hi BR,

There are a series of lessons on tsNet on the LiveCode website:

http://lessons.livecode.com/m/4071/c/235433

If you are looking for an example of how to download something direct to a file, the lesson called “How to asynchronously download via SFTP directly a file” should help.

The same concepts apply for downloading to a file regardless of the protocol being used.

If you can’t quite find an example lesson that answers what you need, let me know and I will get one organised.

Regards,

Charles

> On 2 Jul 2018, at 1:19 am, Sannyasin Brahmanathaswami via use-livecode <[hidden email]> wrote:
>
> I really need to get my head around TSNet, so began experiments.
>
> This is the documentation for tsNetGetFile
>
> " local tHeaders, tResult
>
> put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
> "ftp://user:[hidden email]/file.dat", tHeaders, \
> "transferComplete") into tResult
>
> on transferComplete pID, pResult, pBytes, pCurlCode
>    local tData, tHeaders
>    if pCurlCode is not 0 then
>        answer tsNetRetrError(pID)
>    else
>    a    nswer "File has been downloaded"
>    end if
>    tsNetCloseConn pID
> end transferComplete
>
> # but my first attempt to "get it" ... ran into this error.
>
> Are there any good lessons on all TSNet functions?
> I am not looking forward to wading into this blind as a bat.
>
> # variable watcher
>
> tResult      --        tsneterr: ID already in use
>
> what is strange is this, the IDE gives the error even before tracing the mouseup.
>
> So I did not even get off home plate.
>
> ############
> local tHeaders, tResult
>
> on mouseup
> # put a break here... the IDE show an error *before* stepping into the next statement
> # I can't even close the connection with:
>   tsNetCloseConn "1"
>   put empty into tResult
>   put fld aURL into pURL
>   put empty into fld "fldHTTPHeader"
>   put empty  into fld "tHTMLfield"
>   set the itemDel to "/"
>   put item -1 of pURL into tFileName
>   put ("~/Desktop/"&tFileName) into tLocalFile
>   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete") into tResult
>
>   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
> end mouseup
>
> on transferComplete pID, pResult, pBytes, pCurlCode
>   if pCurlCode is not 0 then
>      answer tsNetRetrError(pID)
>   else
>      answer "File has been downloaded"
>      put tHeaders into fld "fldHTTPHeader"
>   end if
>   tsNetCloseConn pID
> end transferComplete
>
> BR
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
@Charles: Thanks, I look into lessons.

But, using the dictionary example
Why do we get the

> # variable watcher
    >
    > tResult      --        tsneterr: ID already in use

Even *before* the trace the script? I have break

On mouseup

But it gives this error even before starting the trace?

@ Jacqueline: why use TSNet:
1) because the "libURLLastRHHeaders()" are only available to desktop. And I want to see them on mobile
2) because we are working with the "cloud" and async download means I can pass array to TSNet to open connection to download several files at once; like "load" but with more control... ( I think. I have yet to study it out) and get the headers.

Brahmanathaswami
 

On 7/1/18, 3:40 PM, "use-livecode on behalf of Charles Warwick via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    Hi BR,
   
    There are a series of lessons on tsNet on the LiveCode website:
   
    http://lessons.livecode.com/m/4071/c/235433
   
    If you are looking for an example of how to download something direct to a file, the lesson called “How to asynchronously download via SFTP directly a file” should help.
   
    The same concepts apply for downloading to a file regardless of the protocol being used.
   
    If you can’t quite find an example lesson that answers what you need, let me know and I will get one organised.
   
    Regards,
   
    Charles
   
    > On 2 Jul 2018, at 1:19 am, Sannyasin Brahmanathaswami via use-livecode <[hidden email]> wrote:
    >
    > I really need to get my head around TSNet, so began experiments.
    >
    > This is the documentation for tsNetGetFile
    >
    > " local tHeaders, tResult
    >
    > put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
    > "ftp://user:[hidden email]/file.dat", tHeaders, \
    > "transferComplete") into tResult
    >
    > on transferComplete pID, pResult, pBytes, pCurlCode
    >    local tData, tHeaders
    >    if pCurlCode is not 0 then
    >        answer tsNetRetrError(pID)
    >    else
    >    a    nswer "File has been downloaded"
    >    end if
    >    tsNetCloseConn pID
    > end transferComplete
    >
    > # but my first attempt to "get it" ... ran into this error.
    >
    > Are there any good lessons on all TSNet functions?
    > I am not looking forward to wading into this blind as a bat.
    >
    > # variable watcher
    >
    > tResult      --        tsneterr: ID already in use
    >
    > what is strange is this, the IDE gives the error even before tracing the mouseup.
    >
    > So I did not even get off home plate.
    >
    > ############
    > local tHeaders, tResult
    >
    > on mouseup
    > # put a break here... the IDE show an error *before* stepping into the next statement
    > # I can't even close the connection with:
    >   tsNetCloseConn "1"
    >   put empty into tResult
    >   put fld aURL into pURL
    >   put empty into fld "fldHTTPHeader"
    >   put empty  into fld "tHTMLfield"
    >   set the itemDel to "/"
    >   put item -1 of pURL into tFileName
    >   put ("~/Desktop/"&tFileName) into tLocalFile
    >   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete") into tResult
    >
    >   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
    > end mouseup
    >
    > on transferComplete pID, pResult, pBytes, pCurlCode
    >   if pCurlCode is not 0 then
    >      answer tsNetRetrError(pID)
    >   else
    >      answer "File has been downloaded"
    >      put tHeaders into fld "fldHTTPHeader"
    >   end if
    >   tsNetCloseConn pID
    > end transferComplete
    >
    > BR
    >
    >
    > _______________________________________________
    > use-livecode mailing list
    > [hidden email]
    > Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    > http://lists.runrev.com/mailman/listinfo/use-livecode
    >
   
   
    _______________________________________________
    use-livecode mailing list
    [hidden email]
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
Charles: Mysteries

I booted Livecode fresh the morning, and used the same script. But I no longer get

tResult      --        tsneterr: ID already in use.

Dictionary script works as expected "File downloaded"

local tHeaders, tResult

on mouseup
   tsNetCloseConn "1"
   put empty into tResult
   put fld aURL into pURL
   put empty into fld "fldHTTPHeader"
   put empty  into fld "tHTMLfield"
   set the itemDel to "/"
   put item -1 of pURL into tFileName
   put ("/Users/brahmanathaswami/Desktop/"&tFileName) into tLocalFile
   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete") into tResult
 
   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
   
end mouseup

on transferComplete pID, pResult, pBytes, pCurlCode
   
   if pCurlCode is not 0 then
      answer tsNetRetrError(pID)
   else
      answer "File has been downloaded"
      put tHeaders into fld "fldHTTPHeader"
   end if
   tsNetCloseConn pID
end transferComplete

    ># variable watcher
        >
        > tResult      --        tsneterr: ID already in use

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
In reply to this post by Niggemann, Bernd via use-livecode
I looked at the lesson. Quite good!

I think one more lesson may be useful.

In my case I will use a "slide show"  as a use case.

(But there others, thinking of streaming music playlist)

1) Assume you have the URLs for a slideshow;
2) you fetch this by calling JSON/Text file with the urls for a slide show which exists on the server.
3) Let say you have 100 slides/URLs
4) Galleria (our web app jquery/html5) uses "lazyload 3" parameter, which asynchronously loads the next the 3 slides (besides the one you are viewing) in the background, then users view the next slide (already downloaded) -there is no delay.

So, with TSNetGet

How would set this up Livecode?

You don't want to "overwhelm" the phone with async calls to 100 connections/slide. (Galleria suggests "3")

But there is the advantage of taking the call back message,  get 3 at a time, store them in the documents folder, finally the user has the slides show on his phone, later he can view it off line.

At the retrieval of the 100th slide, then we informed the user "Slideshow is download complete."

It the user "bails" on slide 36, when he comes back again. TSNetGet starts over but the only which slide 37.

That last part may not want to part of your lessons. Though it would be easy enough to check "these is a file" and if it is true, then TSGetNet, so "next repeat" without downloading.

I could work this out myself, but is such a common use case, everyone would benefit from it.

Brahmanathaswami
 

On 7/1/18, 3:40 PM, "use-livecode on behalf of Charles Warwick via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    If you can’t quite find an example lesson that answers what you need, let me know and I will get one organised.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
In reply to this post by Niggemann, Bernd via use-livecode
Like Jacque mentioned, I don't think you need to bother with tsNet for  
local files since they should be almost instantly loaded.

I too struggled with tsNet when I first tried to implement it, but  
this website helped me more than the LiveCode pages:  
https://www.techstrategies.com.au/tsnet-resources/

The problem you are encountering is that you can only have one unique  
ID referenced at a time (first parameter). If you try to make another  
call using that ID before the first call is returned then you'll get  
an error. Once a call with the ID has been finished (successful or  
not), that ID is recycled and available for use again.

The documentation doesn't explain well (in my initial understanding)  
that this doesn't have to be "1" or even a number. I experimented with  
random(10000) as my pID before encountering that same "ID already in  
use" error and discovered that for most of my uses I could just  
hard-code a text based ID that made more sense to me when  
troubleshooting like "get new image" or "check for updates" or even  
some variable with a unique value (like your tFileName).

--Andrew Bell


> Date: Sun, 1 Jul 2018 15:19:34 +0000
> From: Sannyasin Brahmanathaswami <[hidden email]>
> To: How LiveCode <[hidden email]>
> Subject: Mastering TS Net
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> I really need to get my head around TSNet, so began experiments.
>
> This is the documentation for tsNetGetFile
>
> " local tHeaders, tResult
>
> put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
> "ftp://user:[hidden email]/file.dat", tHeaders, \
> "transferComplete") into tResult
>
> on transferComplete pID, pResult, pBytes, pCurlCode
> local tData, tHeaders
> if pCurlCode is not 0 then
> answer tsNetRetrError(pID)
> else
> a nswer "File has been downloaded"
> end if
> tsNetCloseConn pID
> end transferComplete
>
> # but my first attempt to "get it" ... ran into this error.
>
> Are there any good lessons on all TSNet functions?
>  I am not looking forward to wading into this blind as a bat.
>
> # variable watcher
>
> tResult      --        tsneterr: ID already in use
>
> what is strange is this, the IDE gives the error even before tracing  
> the mouseup.
>
> So I did not even get off home plate.
>
> ############
> local tHeaders, tResult
>
> on mouseup
> # put a break here... the IDE show an error *before* stepping into  
> the next statement
> # I can't even close the connection with:
>    tsNetCloseConn "1"
>    put empty into tResult
>    put fld aURL into pURL
>    put empty into fld "fldHTTPHeader"
>    put empty  into fld "tHTMLfield"
>    set the itemDel to "/"
>    put item -1 of pURL into tFileName
>    put ("~/Desktop/"&tFileName) into tLocalFile
>    put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete")  
> into tResult
>
>    --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
> end mouseup
>
> on transferComplete pID, pResult, pBytes, pCurlCode
>    if pCurlCode is not 0 then
>       answer tsNetRetrError(pID)
>    else
>       answer "File has been downloaded"
>       put tHeaders into fld "fldHTTPHeader"
>    end if
>    tsNetCloseConn pID
> end transferComplete
>
> BR
>
>
> Date: Sun, 01 Jul 2018 13:00:44 -0500
> From: "J. Landman Gay" <[hidden email]>
> To: How to use LiveCode <[hidden email]>
> Subject: Re: Mastering TS Net
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; format=flowed; charset="us-ascii"
>
> Does TSNet even work with local files? For local files use the read/write
> commands or "get/put url".
>
> With a commercial license you shouldn't need to deal with the lower level
> functions for internet communication. The basic put, post, and get commands
> should do it.
>
> --
> Jacqueline Landman Gay | [hidden email]
> HyperActive Software | http://www.hyperactivesw.com
> On July 1, 2018 10:21:38 AM Sannyasin Brahmanathaswami via use-livecode
> <[hidden email]> wrote:
>
>>
>> tResult      --        tsneterr: ID already in use
>>
>> what is strange is this, the IDE gives the error even before tracing the
>> mouseup.
>>
>> So I did not even get off home plate.
>>
>> ############
>> local tHeaders, tResult
>>
>> on mouseup
>> # put a break here... the IDE show an error *before* stepping into the next
>> statement
>> # I can't even close the connection with:
>>   tsNetCloseConn "1"
>>   put empty into tResult
>>   put fld aURL into pURL
>>   put empty into fld "fldHTTPHeader"
>>   put empty  into fld "tHTMLfield"
>>   set the itemDel to "/"
>>   put item -1 of pURL into tFileName
>>   put ("~/Desktop/"&tFileName) into tLocalFile
>>   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete")  
>> into tResult
>>
>>   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
>> end mouseup
>>
>> on transferComplete pID, pResult, pBytes, pCurlCode
>>   if pCurlCode is not 0 then
>>      answer tsNetRetrError(pID)
>>   else
>>      answer "File has been downloaded"
>>      put tHeaders into fld "fldHTTPHeader"
>>   end if
>>   tsNetCloseConn pID
>> end transferComplete
>>
>> BR
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 2 Jul 2018 11:40:13 +1000
> From: Charles Warwick <[hidden email]>
> To: How to use LiveCode <[hidden email]>
> Subject: Re: Mastering TS Net
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset=utf-8
>
> Hi BR,
>
> There are a series of lessons on tsNet on the LiveCode website:
>
> http://lessons.livecode.com/m/4071/c/235433
>
> If you are looking for an example of how to download something  
> direct to a file, the lesson called ?How to asynchronously download  
> via SFTP directly a file? should help.
>
> The same concepts apply for downloading to a file regardless of the  
> protocol being used.
>
> If you can?t quite find an example lesson that answers what you  
> need, let me know and I will get one organised.
>
> Regards,
>
> Charles
>
>> On 2 Jul 2018, at 1:19 am, Sannyasin Brahmanathaswami via  
>> use-livecode <[hidden email]> wrote:
>>
>> I really need to get my head around TSNet, so began experiments.
>>
>> This is the documentation for tsNetGetFile
>>
>> " local tHeaders, tResult
>>
>> put tsNetGetFile("1", "/path/to/downloaded/file.dat", \
>> "ftp://user:[hidden email]/file.dat", tHeaders, \
>> "transferComplete") into tResult
>>
>> on transferComplete pID, pResult, pBytes, pCurlCode
>>    local tData, tHeaders
>>    if pCurlCode is not 0 then
>>        answer tsNetRetrError(pID)
>>    else
>>    a    nswer "File has been downloaded"
>>    end if
>>    tsNetCloseConn pID
>> end transferComplete
>>
>> # but my first attempt to "get it" ... ran into this error.
>>
>> Are there any good lessons on all TSNet functions?
>> I am not looking forward to wading into this blind as a bat.
>>
>> # variable watcher
>>
>> tResult      --        tsneterr: ID already in use
>>
>> what is strange is this, the IDE gives the error even before  
>> tracing the mouseup.
>>
>> So I did not even get off home plate.
>>
>> ############
>> local tHeaders, tResult
>>
>> on mouseup
>> # put a break here... the IDE show an error *before* stepping into  
>> the next statement
>> # I can't even close the connection with:
>>   tsNetCloseConn "1"
>>   put empty into tResult
>>   put fld aURL into pURL
>>   put empty into fld "fldHTTPHeader"
>>   put empty  into fld "tHTMLfield"
>>   set the itemDel to "/"
>>   put item -1 of pURL into tFileName
>>   put ("~/Desktop/"&tFileName) into tLocalFile
>>   put tsNetGetFile("1",tLocalFile,pURL,tHeaders,"transferComplete")  
>> into tResult
>>
>>   --  put libURLLastHTTPHeaders() into fld "fldHTTPHeader"
>> end mouseup
>>
>> on transferComplete pID, pResult, pBytes, pCurlCode
>>   if pCurlCode is not 0 then
>>      answer tsNetRetrError(pID)
>>   else
>>      answer "File has been downloaded"
>>      put tHeaders into fld "fldHTTPHeader"
>>   end if
>>   tsNetCloseConn pID
>> end transferComplete
>>
>> BR
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
>
> ------------------------------
>
> Message: 9
> Date: Mon, 2 Jul 2018 00:45:43 -0400
> From: "Ralph DiMola" <[hidden email]>
> To: "'How to use LiveCode'" <[hidden email]>
> Subject: RE: Sort IP List
> Message-ID: <000001d411bf$8bc3aeb0$a34b0c10$@net>
> Content-Type: text/plain; charset="us-ascii"
>
> I agree "mind-bogglingly nonsensical"
>
> Something is very odd. If I open the stack with fresh start of the IDE I
> start getting results closer to what I would expect. The by ref is about 5
> to 10% faster. NOW.... Every so often when I open the message box things
> start getting weird and I get those crazy results. If I close msg then it is
> different weird. When I say different I mean that another step in the
> process starts taking longer. Close LC and restart and things are back to
> normal until I open the message box a few times. No pattern as of yet. But I
> do know if you don't open the message box it never goes crazy. I'm going to
> dig in and see what's happening here. If I can get a recipe I'm going to
> send it off to Panos.
>
> Win 10 VM
> LC 9
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> [hidden email]
>
> -----Original Message-----
> From: use-livecode [mailto:[hidden email]] On Behalf
> Of Mark Wieder via use-livecode
> Sent: Saturday, June 30, 2018 11:05 PM
> To: Ralph DiMola via use-livecode
> Cc: Mark Wieder
> Subject: Re: Sort IP List
>
> Ralph-
>
> Not that I'm doubting your findings, but those both seem mind-bogglingly
> nonsensical to me. Can you post your test code?
>
> --
>   Mark Wieder
>   [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ------------------------------
>
> End of use-livecode Digest, Vol 178, Issue 2
> ********************************************




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Mastering TS Net

Niggemann, Bernd via use-livecode
In reply to this post by Niggemann, Bernd via use-livecode
With TSGetNet, is it possible to just get the "status code" ("200" is good, "404" it bad, among other things)

Of a file on a webserver, *before* you download it? If it is a 404 you "bail on the operation", in form the user "Not Found"  but if it is 200, continue to stream it?

Brahmanathaswami
 

On 7/2/18, 5:19 AM, "use-livecode on behalf of Sannyasin Brahmanathaswami via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    I looked at the lesson. Quite good!
   
    I think one more lesson may be useful.
   
    In my case I will use a "slide show"  as a use case.
   
    (But there others, thinking of streaming music playlist)
   
    1) Assume you have the URLs for a slideshow;
    2) you fetch this by calling JSON/Text file with the urls for a slide show which exists on the server.
    3) Let say you have 100 slides/URLs
    4) Galleria (our web app jquery/html5) uses "lazyload 3" parameter, which asynchronously loads the next the 3 slides (besides the one you are viewing) in the background, then users view the next slide (already downloaded) -there is no delay.
   
    So, with TSNetGet
   
    How would set this up Livecode?
   
    You don't want to "overwhelm" the phone with async calls to 100 connections/slide. (Galleria suggests "3")
   
    But there is the advantage of taking the call back message,  get 3 at a time, store them in the documents folder, finally the user has the slides show on his phone, later he can view it off line.
   
    At the retrieval of the 100th slide, then we informed the user "Slideshow is download complete."
   
    It the user "bails" on slide 36, when he comes back again. TSNetGet starts over but the only which slide 37.
   
    That last part may not want to part of your lessons. Though it would be easy enough to check "these is a file" and if it is true, then TSGetNet, so "next repeat" without downloading.
   
    I could work this out myself, but is such a common use case, everyone would benefit from it.
   
    Brahmanathaswami
     
   
    On 7/1/18, 3:40 PM, "use-livecode on behalf of Charles Warwick via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:
   
        If you can’t quite find an example lesson that answers what you need, let me know and I will get one organised.
   
    _______________________________________________
    use-livecode mailing list
    [hidden email]
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode