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
0
Question by adelphiaUK · Oct 24, 2014 at 09:16 AM · networkping

Is web site available from within a scene

I have been searching the Q&A to get an answer but everything I look it either costs money (which, being out of work I currently don't have) or doesn't work in all situations (i.e. public vs private).

What I'm trying to accomplish is to see if a single domain can be reached within Unity by means of a single function.

I simply need a boolean returned but I'm finding it hard to determine which function (if there is one) I can use.

I know you can use "Ping" but this can return true if a public hot spot is available, even if you don't have actual "access" to it.

What I'm looking for is something like...

 public bool webSiteReachable(string webSite) {
     TestConnection result = new TestConnection(webSite);
     return(result.isAccessible);
 }



What I'd like to know is, what function can I use as "TestConnection"?

I hope I've explained myself clearly enough and any help, as always, is greatly appreciated.

Comment
Add comment
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

1 Reply

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

Answer by Diablo404 · Oct 24, 2014 at 09:47 AM

What you're searching is probably WWW ( http://docs.unity3d.com/ScriptReference/WWW.html )

And you could do:

     bool isRecheable = false;

     public IEnumerator webSiteReachable(string webSite) 
    {
       WWW www = new WWW(url);
         yield return www;
       if (String.IsNullOrEmpty(www.error)) 
       {
          isRecheable = true;
       }
       else
       {
           isRecheable = false;
       }

    }

But as you can see your function will have to be IEnumerator type so you'll have to make a global bool OR make a callback at the end of the function.

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 adelphiaUK · Oct 24, 2014 at 12:49 PM 0
Share

Hmm. Thanks for that. I must have totally misread the docs on this one because I looked at it and thought it wasn't sufficient. Perhaps I should read it again.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Ping class producing false positives, alternative to check connectivity? 3 Answers

client to client ping - NAT punchthrough 1 Answer

Does UnityEngine.Ping currently support ipv6 addresses on mobile devices? 0 Answers

How to 100% check internet availability 11 Answers

How can I get the ping from the master server? 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