- Home /
Master / Client - When to close connection ?
Hi,
I'm trying to implement a simple master server like that :
(Master) NetworkServer has a list of of servers
NetworkClient.Connect() to master server at game start
Player clicks on Play => Master sends him an IP to an available server
Client connect to that IP
Does the connection uses bandwith when not sending messages ? Or should I connect when player clicks and close connection when IP is received ?
Is it a bad practice to have two connections (or more) at same time ? (Master / Game server, Chat...)
Answer by ramonfr · Apr 04, 2016 at 09:22 PM
Is it a bad practice to have two connections (or more) at same time ? (Master / Game server, Chat...)
I can't answer the previous questions but I can answer this one. No, it's not a bad practice to have simultaneous connections, it's actually a good practice. Most games handle different kinds of data with different servers. If possible you should handle the chat data and game data from different servers, as you mentioned. It's been a long time since I used the legacy networking library of Unity, and I THINK it wasn't possible to connect to 2 servers at same time back then. Idk if it has changed.
Your answer
Follow this Question
Related Questions
What happens if you call MasterServer.RegisterHost twice with same parameters? 0 Answers
Client connects to server, but Network.peerType returns Disconnected until next click 2 Answers
How connect client to server when ip is private ? 2 Answers
Is there a way to notify to the app once client has connected to server? 2 Answers