You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
due to how the net.Listener Accept function works, it's a blocking method that prevents new client connections until the previous one closes Client.Close(). As such, the Server can only handle one active client connection at a time.
in order to allow multiple Clients the Server has to manage multiple net.Listeners. I found the easiest way to do this is by managing multiple socket connections.
the socket connections are dynamically allocated per each new StartClient call. This way we aren't limited in how many Clients we can use or unnecessarily allocating unneeded resources.
in order to poll new Clients after call a server.Read call, a ServerManager must be used to loop through all of the latest client connections and poll the new Clients on the next server.Read iteration.
Because Read is blocking by default, I added a ReadTimed method that times out after the provided duration.
I tried creating 2 clients to connect to the same server, but it only receives the first one, the second one is waiting for a connection.
The text was updated successfully, but these errors were encountered: