General networking question

Hello everyone.

Let’s assume I have a multiplayer architecture consisting of a gateway, auth server and game servers.
Now more than 5000 clients may want to establish a connection at the same time in order to have a game server assigned to them by the gateway/auth server.

The client will only gets an error saying that it cannot establish a connection, since with the Enet protocol no more than around 5000 connections can be established at the same time.

So how do you create a queue or tell the client to try to connect to another gateway?

As i know ENet has pool which holds peers and you should be able to get count of it. I am not sure but a method like this peer_count() then you check each server active count on gateway and direct to available server.Just update count on the connect and disconnect situations so it would be more stable.

I just wanted to answer your question has no practical example but it is similiar to lobby algorithm