I've tried asking before and got a snarky response so I thought I'd try again, with a new problem that I've more recently run into. Basically, the same code is used for all 4 clients, and the same thing is being sent to each of them using a for loop. However, sometimes the output is different on certain clients and this changes every time I run the code. The client where the error(s) occur is also different. In the client script:
def receieve_message():
while True:
command = client.recv(2048).decode(FORMAT)
if command == "VOTE":
round_one_vote = input("Who would you like to remove: ")
message = ("VOTE1 "+round_one_vote)
send(message)
else:
print(command)
I am sending in either the word VOTE from the server or a string of text. If it is a string of text it should print it out to the client. If it is VOTE it will take an input. I am sending the data from the server like this:
for client in clients:
client.send("VOTE".encode(FORMAT))
When I've just run it, 3 out of 4 clients begin the input check, however the first client prints out VOTE, which should not be happening. When I run it a second, time the first two print out VOTE. There doesn't seem to be a pattern.
Additionally, there are random line breaks sometimes, also arbritarily