mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
refactored code
This commit is contained in:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user