Closed dusty-cjh closed 2 years ago
There's no guarantee that pings, or that the bootstrap nodes will respond, particularly if your IP has made a lot of queries recently. For me:
$ go run -v -race ./cmd/dht ping router.bittorrent.com:6881 router.utorrent.com:6881 --timeout 10s
2022/01/06 22:31:23 main.go:63: public ip: "49.180.133.148"
2022/01/06 22:31:23 main.go:70: dht server on [::]:60773 with id 51461a61d0421b1b8d1957b9ae94d295b4f8853c
router.bittorrent.com:6881: 32f54e697351ff4aec29cdbaabf2fbe3467cc267 ✔: 175.128186ms
router.utorrent.com:6881: 2.000993201s: after 1 tries: transaction timed out
If your network is very slow, or UDP is lossy, you might have trouble getting through. You could provide a higher timeout with the --timeout flag, although I notice that doesn't seem to affect the timeout in ./cmd/dht, that could be a bug.
I'll close this in favour of the discussion, https://github.com/anacrolix/dht/discussions/59.
Here is my try:
go run ./cmd/dht ping router.bittorrent.com:6881 router.utorrent.com:6881
And here is my capture from tcpdump
Actually I also met this question when I using python. Does my operation right ? Could you please give me some advice, thank you very much !