Skip to content
Snippets Groups Projects
Commit 4d1c33ae authored by Michael Zanger's avatar Michael Zanger
Browse files

win mac compatibility

parent 6d84fed1
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ class Server(multiprocessing.Process): ...@@ -37,6 +37,7 @@ class Server(multiprocessing.Process):
self.server_port = server_port self.server_port = server_port
self.local_servers_cache = server_cache self.local_servers_cache = server_cache
self.local_clients_cache = clients_cache self.local_clients_cache = clients_cache
self.last_heartbeat_timestamp = last_heartbeat_timestamp
@staticmethod @staticmethod
def get_local_ip_address(): def get_local_ip_address():
...@@ -104,7 +105,6 @@ class Server(multiprocessing.Process): ...@@ -104,7 +105,6 @@ class Server(multiprocessing.Process):
else: else:
return "Unknown" return "Unknown"
def run(self): def run(self):
print(self.server_id+": "+"Up and running") print(self.server_id+": "+"Up and running")
if self.server_id == "MAIN": if self.server_id == "MAIN":
...@@ -169,7 +169,6 @@ class Server(multiprocessing.Process): ...@@ -169,7 +169,6 @@ class Server(multiprocessing.Process):
except socket.error: except socket.error:
pass # Error handling for connection errors or timeout pass # Error handling for connection errors or timeout
return acknowledgment_received return acknowledgment_received
def listen_for_heartbeats(self): def listen_for_heartbeats(self):
while True: while True:
...@@ -391,11 +390,11 @@ class Server(multiprocessing.Process): ...@@ -391,11 +390,11 @@ class Server(multiprocessing.Process):
def listen_for_cache_update(self): def listen_for_cache_update(self):
BROADCAST_ADDRESS = self.get_broadcast_address() BROADCAST_ADDRESS = self.get_broadcast_address()
BROADCAST_PORT = 5980 BROADCAST_PORT = 5980
print("listen for cache update")
# Local host information # Local host information
MY_HOST = socket.gethostname() MY_HOST = socket.gethostname()
MY_IP = socket.gethostbyname(MY_HOST) MY_IP = socket.gethostbyname(MY_HOST)
print("listen for cache update")
# Create a UDP socket # Create a UDP socket
listen_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) listen_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Set the socket to broadcast and enable reusing addresses # Set the socket to broadcast and enable reusing addresses
......
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