Skip to content
Snippets Groups Projects
Commit a61a8d32 authored by Quoc Nguyen Dao's avatar Quoc Nguyen Dao
Browse files

Fix

parent 4e3b5b9c
No related branches found
No related tags found
1 merge request!2leader election und heartbeat
......@@ -46,7 +46,7 @@ class Server():
# Listen to server broadcasts and reply with own IP
server_broadcast_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_broadcast_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_broadcast_socket.bind(('', BROADCAST_PORT_SERVER))
server_broadcast_socket.bind((MY_IP, BROADCAST_PORT_SERVER))
while True:
data, addr = server_broadcast_socket.recvfrom(1024)
......@@ -81,7 +81,7 @@ class Server():
# Set the socket to broadcast and enable reusing addresses
client_broadcast_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# Bind socket to address and port
client_broadcast_socket.bind(('', BROADCAST_PORT_CLIENT))
client_broadcast_socket.bind((MY_IP, BROADCAST_PORT_CLIENT))
print("Listening to broadcast messages")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment