import (
"flag"
+ "fmt"
"regexp"
"runtime"
"testing"
errc <- err
}()
}
- case "darwin":
+ case "darwin", "windows":
// At least OS X 10.7 seems to accept any number of
// connections, ignoring listen's backlog, so resort
// to connecting to a hopefully-dead 127/8 address.
// Same for windows.
+ //
+ // Use a bogus port (44444) instead of 80, because
+ // on our 386 builder, this Dial succeeds, connecting
+ // to an IIS web server somewhere. The data center
+ // or VM or firewall must be stealing the TCP connection.
go func() {
- _, err := DialTimeout("tcp", "127.0.71.111:80", 200*time.Millisecond)
+ c, err := DialTimeout("tcp", "127.0.71.111:44444", 200*time.Millisecond)
+ if err == nil {
+ err = fmt.Errorf("unexpected: connected to %s!", c.RemoteAddr())
+ c.Close()
+ }
errc <- err
}()
default: