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 Jerad · Jun 29, 2010 at 03:48 PM · connecttimeout

Extend Network.Connect's connection attempt time

Begins I didn't get an answer to the question I asked last time I asked, I'll ask again:

Is there a way to adjust how long Network.Connect attempts to connect before it gives up, right now it seems to attempt for about 8 seconds before giving up if it can't find the host, I was wondering if that time could be made longer?

Example: You click the connect button, which triggers this piece of code (JUST ONCE and INSTANTLY) when you click:

Network.Connect(AValidAndExistingIP, AValidPort);

By default, that continues to try for (about) 8 seconds before it gives up and returns an error that it couldn't connect, I want to know if there is a way to extend how long it TRYS TO CONNECT. Because right now, if you had an 800ms ping, you wouldn't be able to connect, mind you if you were playing an FPS, you'd obviously quit the server, but in this case I'm not using the code for an fps, and things will still work with pings higher than 8 seconds, the important part is they need to be able to connect, regardless how bad their ping is.

I hope that leaves less confusion as to what I'm actually asking this time.

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
0

Answer by AKAssassin · Apr 25, 2011 at 07:20 PM

You should not be concerned with the amount of time it spends trying to connect, 800ms ping would not take longer than 8 seconds, it would be 8/10s of a second. Anyways, you should just keep trying to reconnect over and over again.

So.. //Connect

if(failedToConnect){ //Attempt to connect again, probably will want to stop doing this after a while though //and accept the fact that connection isn't going to happen. }

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

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

No one has followed this question yet.

Related Questions

Network.Connect Connect Attempt Timeout 1 Answer

Unity server connection time out 0 Answers

Ragdoll joints aren't staying connected. 0 Answers

Unhandled message 65 from local ip. 0 Answers

Can i connect java program with unity 3d game ? 0 Answers


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