Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
2
Question by kashif789us · Jun 23, 2017 at 05:30 AM · networkingserverclienttimeout

ServerDisconnected due to error: Timeout

Hello. I am working on a MMO game using UNet. I have a headless server running on Linux Ubuntu hosted on AWS. Clients get connected to it and players can play with each other. After about 15 to 20 minutes all clients are disconnected and server shows the following error:

Log: connection {} has been disconnected by timeout; address {::ffff:} time {2666259}, last rec time {2660314} rtt {299} timeout {5000} ServerDisconnected due to error: Timeout

As I am new to multiplayer I am unable to figure out what causes it. I am seeing the resources on AWS and everything looks fine.

Following are my timeout settings in NetworkManager:

Minimum Update Timeout: 1 ms

Connect Timeout: 5000 ms

Disconnect Timeout: 5000 ms

Ping Timeout: 3000 ms

Any help would be greatly appreciated.

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 IgorAherne · Feb 11, 2020 at 11:51 AM 0
Share

did you got this solved? I also have this in 2020

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by IgorAherne · Feb 11, 2020 at 09:04 PM

Have a look here: http://answers.unity.com/answers/1443850/view.html

In case the original post is removed, here it is:

These are the initialization settings that worked for us:

void InitializeNetwork(){

myConfig.AddChannel(QosType.Reliable);

myConfig.AddChannel(QosType.Unreliable); myConfig.AddChannel(QosType.StateUpdate); myConfig.AddChannel(QosType.AllCostDelivery); myConfig.NetworkDropThreshold = 95; //95% packets that need to be dropped before connection is dropped myConfig.OverflowDropThreshold = 30; //30% packets that need to be dropped before sendupdate timeout is increased myConfig.InitialBandwidth = 0; myConfig.MinUpdateTimeout = 10; myConfig.ConnectTimeout = 2000; // timeout before re-connect attempt will be made myConfig.PingTimeout = 1500; // should have more than 3 pings per disconnect timeout, and more than 5 messages per ping myConfig.DisconnectTimeout = 6000; // with a ping of 500 a disconnectimeout of 2000 is supposed to work well myConfig.PacketSize = 1470; myConfig.SendDelay = 2; myConfig.FragmentSize = 1300; myConfig.AcksType = ConnectionAcksType.Acks128; myConfig.MaxSentMessageQueueSize = 256; myConfig.AckDelay = 1; HostTopology myTopology = new HostTopology(myConfig, 4); //up to 4 connection allowed NetworkServer.Configure(myTopology);

}

Also, if you are hard-coding a port, make sure it's large enough. I had port 1777 which was causing issues on Ubuntu, so changing it to 17777 helped as well.

 _hostId = NetworkTransport.AddHost(topo, 17777, null);

And, if you are still experiencing disconnect, make sure you are setting ping to be frequent enough. 1000 as in the example above wasn't enough. Had to reduce it down to 150 to stop these time-outs. Obviously this will consume more bandwidth.

  myConfig.PingTimeout = 170;
  myConfig.DisconnectTimeout = 6000; 
  myTopology = new HostTopology(myConfig, 4); //up to 4 connection allowed 
  NetworkServer.Configure(myTopology);

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 Bryan-Legend · Jun 19, 2020 at 10:59 PM 0
Share

Going to a higher port number totally worked for me! Thanks a million!

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

131 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UDPClient can't receive and send ? 0 Answers

Need help spawning a gameObject on the server UNET 1 Answer

non-player object can't execute's "[Command]"'s attributes 0 Answers

UNET] How to make server tell all clients to do something? 1 Answer

Are networked object pools possible? 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