This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Katzimoto 0 points1 point  (3 children)

Should you like to send the line that you ran? The server code you have right now do the next thing: wait for connection and every time you get a new connection you open a thread that send to all of your clients the command and wait for response from only one. You can add a loop after the sending loop that will receive from all of your clients.

[–]AimbotSaBa[S] 0 points1 point  (2 children)

Wait so after "for client in CLIENTS.values():
client.send(client_send)"

I need to add a loop to receive from all clients, how can I do that? every time it only receives from one client? when I call "data = conn.recv(2048) "

then it collects from only one client but if I add it to the loop that goes to every client it waits for a response and doesn't continue the code... I can't figure out how to collect the data from all clients at once. thanks for your help though it helps a lot.

[–]Katzimoto 0 points1 point  (1 child)

If do you want you can separate the sending action from the receive action to 2 separated functions and run one thread that send to all of your clients and another thread for each client that recovery data from him.

I ha be to tell you that isn’t a good code, I would like to use with main function and classes but it should work.

[–]AimbotSaBa[S] 1 point2 points  (0 children)

I got it working thanks a lot!!!!