- Home /
what happens if www cannot connect?
What happens if www cannot connect, how long does it take before it times out. If I use yield will it just hang if it can't connect or will it timeout eventually?
Answer by drastick · Oct 17, 2012 at 06:42 PM
See the example of WWW.error they toss in an invalid URL (i.e. something that will no connect). Yield will allow other code to run, if you have code following yield on a WWW that you are expecting to run while the WWW is connecting then your code structure needs to change to support WWW connection and results as asynchronous.
http://docs.unity3d.com/Documentation/ScriptReference/WWW-error.html
As for the timeout for a valid yet non responsive url, I'm not sure how long it will go before the error case is triggered. If you want to force a time out sooner, you could use WWW.progress to check to see if the delay is due to connection or download and force the WWW to close if it is taking too long for you. browser might spin until it deter$$anonymous$$es that they connection can not be established. If you set up the yield logic correctly it should not lock up unity or the game code.
Your answer
Follow this Question
Related Questions
UnityWebRequest timing out ? Send() finishes but isDone = false 1 Answer
Issues with WWW resource loading 1 Answer
How to yiled a try/catch block? 2 Answers
yield return on WWW never coming back? 0 Answers
yield WWW doesn't work 1 Answer