Skip to content
Snippets Groups Projects
Commit f5cc6067 authored by Luca Randazzo's avatar Luca Randazzo
Browse files

Update 2025-01-10_Server_V6.py

parent 6a5999b2
No related branches found
No related tags found
1 merge request!1Feat/finalfinal
......@@ -198,9 +198,9 @@ def new_server_in_ring():
msg = json.dumps(members_IP).encode() # If the server already exists, send the updated member list
else:
members_IP.append(new_IP) # If the server is new, add its IP to the list
msg = f"There are already servers. I am your leader: {ip_address}" # Create a message for the new server
msg = f"There are already servers. I am your leader: {ip_address}".encode() # Create a message for the new server
#AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'?
sock.sendto(msg.encode(), (new_IP, new_server_port)) # Send the greeting message back to the new server
sock.sendto(msg, (new_IP, new_server_port)) # Send the greeting message back to the new server
print(f"The updated IP_Ring is: {members_IP}")
send_update_to_ring() # Update the ring topology
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment