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…)

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.