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 /
avatar image
1
Question by hMark · Sep 04, 2015 at 09:29 PM · unity 5networkingunity5networkconnection

UNet NetworkServer max connections

Is it possible to change number of max. connections for NetworkServer? It looks that the default value is 8.

When I am trying to setup it this way (e.g. with 100 connections):

 ConnectionConfig config = new ConnectionConfig();
 NetworkServer.Configure(config, 100);

then all clients throw error UNet Client Disconnect Error: CRC Mismatch.

Thanks for responses.

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

4 Replies

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

Answer by hMark · Sep 08, 2015 at 01:03 PM

Ok, finally I found fix. The issue was that client must have also attached connection config (dunno why). Then I needed to setup channels because config does not defined any.

server:

 ConnectionConfig config = new ConnectionConfig();
 config.AddChannel(QosType.ReliableSequenced);
 config.AddChannel(QosType.Unreliable);
 NetworkServer.Configure(config, MaxConnections);
 NetworkServer.Listen(Port);

client:

 client = new NetworkClient();
 ConnectionConfig config = new ConnectionConfig();
 config.AddChannel(QosType.ReliableSequenced);
 config.AddChannel(QosType.Unreliable);
 client.Configure(config, 1000);
 client.Connect(IpAddress, Port);
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
avatar image
3

Answer by glenwatkinson · Feb 08, 2017 at 04:10 PM

Was having the same issue but tried a different fix: enable advanced configuration in your network manager and set the maximum number of connections there. I couldn't add more than 8 players on a LAN game I'm developing until I made that change.

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 bcsquared · Aug 27, 2017 at 02:49 PM 1
Share

I'm running into this issue with 5.6.2f1. But I cannot go above 1 server and 6 clients. I changed the max connections to 15 and pushed that build to both my server and clients. But I still get the UNET Disconnect Error: No Resources issue.

avatar image
0

Answer by LeopardX · Sep 07, 2015 at 03:48 AM

Hi @hMark Not sure if your using the new networking in unity 5, but you can also set the max connections on the NetworkManager..

Heres an example: using UnityEngine; using System.Collections; using UnityEngine.Networking;

  public class StartServer : MonoBehaviour {
     
         string HostName = "127.0.0.1";
     
         // Starts the server as host
         public void _StartupHost()
         {
             NetworkManager.singleton.networkPort = 7777;
             NetworkManager.singleton.maxConnections = 50;
             NetworkManager.singleton.StartHost ();
         }
     
         // Connects to the server as a client
         public void _JoinWorld()
         {
             NetworkManager.singleton.networkAddress = HostName;
             NetworkManager.singleton.networkPort = 7777;
             NetworkManager.singleton.StartClient ();
         }
     }
 
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 hMark · Sep 07, 2015 at 09:27 AM 0
Share

same problem (number of connections is still 8). the only difference is that it does not throw error with your code

avatar image
0

Answer by PaulosCreations · May 17, 2016 at 12:57 PM

Only on the Server :

 manager = GetComponent<NetworkManager>();

     var config = new ConnectionConfig();
     config.AddChannel(QosType.Reliable);
     config.AddChannel(QosType.Unreliable);

     manager.StartServer(config, maxConnections);

Client needs nothing other than :

 manager = GetComponent<NetworkManager>();

     manager.StartClient();

Assuming you are using or are deriving from the NetworkManager.

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

7 People are following this question.

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

Related Questions

Unet NetworkServer.Spawn() not working 5 Answers

unity networking not working,Unity networking not working 0 Answers

UNET Direct IP Connection not working 0 Answers

UNET "no free events for message" when client pauses game. 2 Answers

Unity network perfomance 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