Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Julien-Lynge · Nov 11, 2011 at 06:40 PM · webplayerwwwftpwww.error

Webplayer throwing FTP errors as popups

I'm using the WWW class to grab imagery from an ftp server. The ftp server limits the downloads to 5 simultaneously. When I kick off a bunch of requests I handle this gracefully: I have a loop that checks the www progress of each download, and when it detects a 421 error (too many connections) it stops the download, disposes the WWW call, and adds the download to a queue to be restarted when another download finishes. I also catch permanent errors (e.g. file not found) and handle those gracefully.

All of this works perfectly in standalone versions, tested on both Windows and Mac. However, in the webplayer, every time the WWW encounters an ftp error it seems to immediately return it to the browser, which then sends a popup error to the user. The popup is in the following format ([Title:] indicates what's in the popup titlebar). Each one has a yellow warning icon next to the text.

 [Title:]Alert
 421 There are too many connections from your internet address.

 [Title:]Alert
 550 Failed to change directory.

 [Title:]Alert
 425 failed to establish connection

Since I might kick of 15 of these at a time, I end up spamming the user with 10 popups. Clearly not acceptable.

Any idea how to prevent Unity from sending these to the browser? This is a serious WTF error - why would Unity, a game engine, ever throw an error like this to the browser even if I weren't handling things gracefully?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Julien-Lynge · Nov 11, 2011 at 06:47 PM 0
Share

BTW: If you want to test this, just set up a WWW call with a bad address, e.g. ftp://thisisabadaddress

Then, I have a loop set up like this:

 private IEnumerator monitorDownload()
 {
     while (state == State.Downloading)
     {
         if (www.isDone)
         {
             if (www.error != null)
             {
                 Debug.Log("Could not download texture from " + url + ": " + www.error);
                 if (www.error.Contains("421"))
                 {
                     state = State.Queued;
                     Debug.Log("FTP server rejected download (" + url + "), adding to queue.");
                     www.Dispose();
                 }
                 else //died with fatal error
                 {
                     downloadFinished(false);
                 }
             }
             else //download succeeded
             {
                 downloadFinished(true);
             }

             //close the thread
             yield break;
         }
         else //downloading
         {
         }
         yield return new WaitForEndOfFrame();
     }
      
 }

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Bunny83 · Nov 11, 2011 at 11:23 PM

Well, as far as i know the www calls work a lot different in the webplayer. Unity does those requests via the browser and doesn't do the connection itself. I guess it completely depends on the browser you use if such a warning is displayed or not.

So i guess it's actually the other way round: Not Unity passes the error to the browser, the browser passes the result to unity so i guess there's not really a way to prevent the browser from doing that when using the WWW component.

It still should be possible to use .NET / Mono to establish the connection and handle the download yourself. Make sure you read the Security Sandbox documentation carefully when you want to try that.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Julien-Lynge · Nov 12, 2011 at 12:46 AM 0
Share

Thanks Bunny, that really clears things up for me. I'll poke around the documentation, and if we come up with anything clever I'll try to post it to the forums.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How do I properly send binary data (byte[]) to a MySQL database? 4 Answers

Having Trouble with Javascript GET and URL 1 Answer

Failed downloading http with WWW on Internet Explorer 0 Answers

Bytes array always empty in WWW object (on WebPlayer) 0 Answers

webplayer www sendmessage to loadExternalImage with parameter (url) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges