Skip to content

Commit

Permalink
net: fix BenchmarkWriteToReadFromUDP on Windows
Browse files Browse the repository at this point in the history
Using 0.0.0.0 for ListenUDP listens on all addresses. Calling LocalAddr
on that Conn returns 0.0.0.0. Sending to 0.0.0.0 doesn't seem to work on
Windows. See #22827.

Change-Id: I4a48fbabe65a63e07600a65309977cec08a9c1e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/301850
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Trust: Filippo Valsorda <filippo@golang.org>
  • Loading branch information
FiloSottile authored and dr2chase committed Mar 15, 2021
1 parent de2b27d commit 661f3f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net/udpsock_test.go
Expand Up @@ -447,7 +447,7 @@ func TestUDPReadSizeError(t *testing.T) {
}

func BenchmarkWriteToReadFromUDP(b *testing.B) {
conn, err := ListenUDP("udp4", new(UDPAddr))
conn, err := ListenUDP("udp4", &UDPAddr{IP: IPv4(127, 0, 0, 1)})
if err != nil {
b.Fatal(err)
}
Expand Down

0 comments on commit 661f3f1

Please sign in to comment.