MCPcopy
hub / github.com/golang/net / TestConnInitiatorPathMTU

Function TestConnInitiatorPathMTU

ipv6/sockopt_test.go:19–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestConnInitiatorPathMTU(t *testing.T) {
20 switch runtime.GOOS {
21 case "fuchsia", "hurd", "js", "nacl", "plan9", "windows", "wasip1", "zos":
22 t.Skipf("not supported on %s", runtime.GOOS)
23 }
24
25 if _, err := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback); err != nil {
26 t.Skip("ipv6 is not enabled for loopback interface")
27 }
28
29 ln, err := net.Listen("tcp6", "[::1]:0")
30 if err != nil {
31 t.Fatal(err)
32 }
33 defer ln.Close()
34
35 done := make(chan bool)
36 go acceptor(t, ln, done)
37
38 c, err := net.Dial("tcp6", ln.Addr().String())
39 if err != nil {
40 t.Fatal(err)
41 }
42 defer c.Close()
43
44 if pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {
45 t.Fatal(err)
46 } else {
47 t.Logf("path mtu for %v: %v", c.RemoteAddr(), pmtu)
48 }
49
50 <-done
51}
52
53func TestConnResponderPathMTU(t *testing.T) {
54 switch runtime.GOOS {

Callers

nothing calls this directly

Calls 10

RoutedInterfaceFunction · 0.92
NewConnFunction · 0.92
acceptorFunction · 0.85
SkipMethod · 0.80
PathMTUMethod · 0.80
CloseMethod · 0.65
DialMethod · 0.65
StringMethod · 0.65
AddrMethod · 0.65
RemoteAddrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…