i have started working on python chat, using sockets.
I am now having a problem with connecting many clients to the server, because if they connect to the same port they won't be able to communicate live, because each client would wait in line until the port will be free. Now my idea was to choose (on the server side) how many clients I want first, then open that range of ports using a simple for function and threads. Now my problem is that on my client size I am using try, when the "try" point is connecting to the port. At first I thought if somebody already connected to some port it will throw an error so the client will just jump to next port, but I forgot about that line thing. Any ideas?
Never mind i figures it out. My mistake was that i opened new socket with every thread, while should have opened that once in main() func, then do the accept in the thread. Thank you all
Trying to create Python chat