Browser widget timeout?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Browser widget timeout?
Hello,
I'm not familiar with the Browser widget and I would like to know the better way to set and handle a timeout while loading a distant web page in an existing Browser widget.
I know I can check is the page is loaded or failed with browserDocumentLoadComplete and browserDocumentLoadFailed, but I don't know how to manage a timeout.
I'm using LC Indy 9.04.
Thank you.
I'm not familiar with the Browser widget and I would like to know the better way to set and handle a timeout while loading a distant web page in an existing Browser widget.
I know I can check is the page is loaded or failed with browserDocumentLoadComplete and browserDocumentLoadFailed, but I don't know how to manage a timeout.
I'm using LC Indy 9.04.
Thank you.
Re: Browser widget timeout?
Hi Zax,
not sure if this also applies to the browser widget, but try to:
Best
Klaus
not sure if this also applies to the browser widget, but try to:
Code: Select all
...
set the socketTimeoutInterval to XXXX
## Where XXXX is the amount in millisecsonds
...
Klaus
Re: Browser widget timeout?
BTW, I will move this thread to the correct forum...
Re: Browser widget timeout?
Hello Klaus !
socketTimeoutInterval doesn't seem to work with a Browser widget.
That's why I originaly posted in Widgets sub-forum, following [-hh] 's advice here:
https://forums.livecode.com/viewtopic.p ... 6&start=15
socketTimeoutInterval doesn't seem to work with a Browser widget.
That's why I originaly posted in Widgets sub-forum, following [-hh] 's advice here:
https://forums.livecode.com/viewtopic.p ... 6&start=15
[-hh] wrote: ↑Mon Sep 16, 2019 12:31 pmThere is an own subform for LiveCode Builder (especially widgets (especially the browser widget)):
viewforum.php?f=93
-
- VIP Livecode Opensource Backer
- Posts: 9838
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Browser widget timeout?
What went wrong with the server that it's timing out?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Browser widget timeout?
Well, socketTimeout message doesn't seem to be sent, even when I use:
In fact, I think I don't understand how to use sockets with Browser widget. Documentation says:
Klaus, maybe you will have to move this thread to the Beginner section.
Code: Select all
set the socketTimeoutInterval to 1
But where should I read or write this socket when using Browser widget?If the socketTimeoutInterval passes and no data has been transmitted yet, the socketTimeout message is sent to the object(glossary) whose script contains the read from socket or write to socket command.
Klaus, maybe you will have to move this thread to the Beginner section.
Re: Browser widget timeout?
1. "sockettimeoutintervall" is NOT a message but a global property, which decides after what time a "socket" action (read/write) is considered to be "timed out". So you need to set this to a desired value BEFORE you set the url of the browser widget.
2. You don't have to "use" sockets with the Breowser widget, the widget does this by its own!
3. Nope, this seems to be the best place for this thread.
Please try again with my hints in 1.
2. You don't have to "use" sockets with the Breowser widget, the widget does this by its own!
3. Nope, this seems to be the best place for this thread.
Please try again with my hints in 1.
Re: Browser widget timeout?
This is what I tried:
Test button script
Browser widget script
Card script
socketTimeout message doesn't seem to be sent, as I don't see the answer dialog (even if I change the value of socketTimeoutInterval)
What I am doing wrong?
Test button script
Code: Select all
on mouseUp
set the socketTimeoutInterval to 1--milliseconds
set the URL of widget "BrowserTest" to "https://livecode.com"
end mouseUp
Code: Select all
on socketTimeout
answer "Timeout! (widget)"
end socketTimeout
Code: Select all
on socketTimeout
answer "Timeout! (card)"
end socketTimeout
What I am doing wrong?
Re: Browser widget timeout?
Well, 1 millisecs is a BIT short!
Default value is 10000 = 10 seconds, as one can read in the dictionary entry about "sockettimeoutintervall".
So give it a bit more time for your action, if it times out in these default 10 seconds and see if that helps.
As I said, I am not sure if this and/or the "socketimeout" message does also apply to the browser widget.
Default value is 10000 = 10 seconds, as one can read in the dictionary entry about "sockettimeoutintervall".
So give it a bit more time for your action, if it times out in these default 10 seconds and see if that helps.
As I said, I am not sure if this and/or the "socketimeout" message does also apply to the browser widget.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Browser widget timeout?
No matter what you do later on with the url data, you could use "load url" which has an optional callback message and is not blocking.
[Klaus is right. This is nothing special to the browser widget (that displays the url). That's "internet" in general.]
[Klaus is right. This is nothing special to the browser widget (that displays the url). That's "internet" in general.]
shiftLock happens
Re: Browser widget timeout?
I performed another test with:
Button script:
Card script
And I still never saw the socketTimeout message.
I can't test values of socketTimeoutInterval greater than 2 seconds because my internet connexion is fast and didn't find very slow websites at this time
Button script:
Code: Select all
on mouseUp
urlTest
end mouseUp
Card script
Code: Select all
on urlTest
set the socketTimeoutInterval to 1000--milliseconds
put "https://livecode.com" into theUrl
unload URL theUrl -- clear cache
load URL theUrl with message "loadingComplete"
end urlTest
on loadingComplete
answer "loadingComplete (card) ***"
end loadingComplete
on socketTimeout
answer "Timeout! (card) ***"
end socketTimeout
I can't test values of socketTimeoutInterval greater than 2 seconds because my internet connexion is fast and didn't find very slow websites at this time
Re: Browser widget timeout?
In your initial posting you said that you get a TIMEOUT ("...while loading a distant web page in an existing Browser widget")
and now you are telling us you don't?
Re: Browser widget timeout?
Nooooo dear Klaus!
I asked how to correctly handle a timeout.
I said I have a fast connexion, but slow connexion happens (for example when my provider is half-down by a cyber attack ^^, and slow websites exist). If I create a little utility with a Browser widget, I think I have to handle some errors, including timeout.
EDIT
I found a rather slow website, just try:
https://community.adobe.com/t5/Photoshop/bd-p/photoshop
Re: Browser widget timeout?
I'm kinda curious why putting break points in all of his handlers doesn't trigger past the original handler
Re: Browser widget timeout?
I am not very familiar with all this internet stuff and "socketimeoutintervall" was
the first thing that came into my mind. I'm afraid I cannot be of any more help.
the first thing that came into my mind. I'm afraid I cannot be of any more help.