Source File
bind_udp.go
Belonging Package
github.com/tmc/go-iroh/iroh
//go:build !jspackage irohimport ()func bindPacketConn( config, netip.AddrPort) (*net.UDPConn, error) {if .disableIP {return nil, nil}// Bind an IPv4 address on an IPv4 socket. net.ListenUDP("udp", ...) gives// 0.0.0.0 a dual-stack socket whose LocalAddr reports [::], so a caller// that asked for IPv4 would get an IPv6 address back from// Endpoint.LocalAddr. The default bind address is the IPv6 unspecified// address, so the default socket stays dual-stack.:= "udp"if .Addr().Is4() {= "udp4"}return net.ListenUDP(, net.UDPAddrFromAddrPort())}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |