refactored code

This commit is contained in:
sumanjeet0012@gmail.com
2025-06-20 16:08:04 +05:30
parent 3262749db7
commit f43e7e367a
4 changed files with 34 additions and 69 deletions

View File

@ -47,7 +47,6 @@ class PeerBroadcaster:
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
s.connect(("8.8.8.8", 80))
local_ip = s.getsockname()[0]
print(f"Local IP determined: {local_ip}")
return local_ip
except Exception:
# Fallback to localhost if we can't determine the IP
@ -55,7 +54,6 @@ class PeerBroadcaster:
def register(self) -> None:
"""Register the peer's mDNS service on the network."""
print(repr(self.service_info))
self.zeroconf.register_service(self.service_info)
def unregister(self) -> None: