Skip to content

Commit fa3c530

Browse files
committed
Update ping example
1 parent 35bc955 commit fa3c530

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/ping/ping.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import multiaddr
55
import trio
66

7+
from examples.advanced.network_discover import get_optimal_binding_address
78
from libp2p import (
89
new_host,
910
)
@@ -70,6 +71,9 @@ async def run(port: int, destination: str, psk: int, transport: str) -> None:
7071
if port <= 0:
7172
port = find_free_port()
7273

74+
_ = get_available_interfaces(8000)
75+
_ = get_optimal_binding_address(8000)
76+
7377
if transport == "tcp":
7478
listen_addrs = get_available_interfaces(port)
7579
if transport == "ws":

0 commit comments

Comments
 (0)