Under the condition that A [connect to B] ----> [inbound] B peer exists,
Hole punching will not occur if A-peer is restarted.
Because,
|
func (nn *netNotifiee) Connected(_ network.Network, conn network.Conn) { |
is called, but
- For UDP or unintended disconnection is not detected immediately,
|
if getDirectConnection(hp.host, rp) != nil { |
incorrectly assumes that a connection already exists.
2025-10-30T23:02:34.648+0900 �[35mDEBUG�[0m p2p-holepunch holepunch/holepuncher.go:95 beginDirectConnect {"host": "12D3KooWLcU8rxuwQphJq7DJGRwPx6qdFY8Aj6thpdjXyTcshEe6", "peer": "12D3KooWBAm5U5jMMeasz15KnP7Tg4fn2Qd68WAc7YzJoSosfPmt"}
2025-10-30T23:02:34.648+0900 �[35mDEBUG�[0m p2p-holepunch holepunch/holepuncher.go:112 already connected {"host": "12D3KooWLcU8rxuwQphJq7DJGRwPx6qdFY8Aj6thpdjXyTcshEe6", "peer": "12D3KooWBAm5U5jMMeasz15KnP7Tg4fn2Qd68WAc7YzJoSosfPmt"}
Version Information
github.com/libp2p/go-buffer-pool v0.1.0
github.com/libp2p/go-cidranger v1.1.0
github.com/libp2p/go-doh-resolver v0.5.0
github.com/libp2p/go-flow-metrics v0.3.0
github.com/libp2p/go-libp2p v0.43.0
github.com/libp2p/go-libp2p-asn-util v0.4.1
github.com/libp2p/go-libp2p-kad-dht v0.34.0
github.com/libp2p/go-libp2p-kbucket v0.7.0
github.com/libp2p/go-libp2p-record v0.3.1
github.com/libp2p/go-libp2p-routing-helpers v0.7.5
github.com/libp2p/go-libp2p-testing v0.12.0
github.com/libp2p/go-libp2p-xor v0.1.0
github.com/libp2p/go-msgio v0.3.0
github.com/libp2p/go-netroute v0.2.2
github.com/libp2p/go-reuseport v0.4.0
github.com/libp2p/go-yamux/v5 v5.0.1
github.com/libp2p/zeroconf/v2 v2.2.0
Under the condition that
A [connect to B] ----> [inbound] Bpeer exists,Hole punching will not occur if A-peer is restarted.
Because,
go-libp2p/p2p/protocol/holepunch/holepuncher.go
Line 279 in 7b78dd6
go-libp2p/p2p/protocol/holepunch/holepuncher.go
Line 111 in 7b78dd6
Version Information