Try to fix logic
This commit is contained in:
parent
91e7b0ace8
commit
fe4aa750fe
1 changed files with 1 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ def handle_client(sock, client_address, socket_list, usernames, chat_rooms, clie
|
||||||
chat_room = chat_rooms.get(sock, "default")
|
chat_room = chat_rooms.get(sock, "default")
|
||||||
send_message = f"{username} >> {message}".encode('utf-8')
|
send_message = f"{username} >> {message}".encode('utf-8')
|
||||||
for client_sock in socket_list:
|
for client_sock in socket_list:
|
||||||
if client_sock != sock and chat_rooms.get(client_sock) == chat_room:
|
if chat_rooms.get(client_sock) == chat_room:
|
||||||
try:
|
try:
|
||||||
client_sock.send(send_message)
|
client_sock.send(send_message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue