Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1696)

Delta Between Two Patch Sets: ipv4/multicastlistener_test.go

Issue 6482044: code review 6482044: go.net/ipv4: new package (Closed)
Left Patch Set: diff -r 2513e9008213 https://code.google.com/p/go.net Created 11 years, 6 months ago
Right Patch Set: diff -r 2513e9008213 https://code.google.com/p/go.net Created 11 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « ipv4/multicast_test.go ('k') | ipv4/multicastsockopt_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build darwin freebsd linux openbsd 5 // +build darwin freebsd linux netbsd openbsd
6 6
7 package ipv4_test 7 package ipv4_test
8 8
9 import ( 9 import (
10 "code.google.com/p/go.net/ipv4" 10 "code.google.com/p/go.net/ipv4"
11 "net" 11 "net"
12 "os" 12 "os"
13 "testing" 13 "testing"
14 ) 14 )
15 15
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 61
62 func TestUDPMultipleConnWithMultipleGroupListeners(t *testing.T) { 62 func TestUDPMultipleConnWithMultipleGroupListeners(t *testing.T) {
63 if testing.Short() || !*testExternal { 63 if testing.Short() || !*testExternal {
64 t.Logf("skipping test to avoid external network") 64 t.Logf("skipping test to avoid external network")
65 return 65 return
66 } 66 }
67 67
68 for _, tt := range udpMultipleGroupListenerTests { 68 for _, tt := range udpMultipleGroupListenerTests {
69 // listen to a group address, actually a wildcard address 69 // listen to a group address, actually a wildcard address
70 » » // with resuable port 70 » » // with reusable port
71 c1, err := net.ListenPacket("udp4", "224.0.0.0:1024") // see RFC 4727 71 c1, err := net.ListenPacket("udp4", "224.0.0.0:1024") // see RFC 4727
72 if err != nil { 72 if err != nil {
73 t.Fatalf("net.ListenPacket failed: %v", err) 73 t.Fatalf("net.ListenPacket failed: %v", err)
74 } 74 }
75 defer c1.Close() 75 defer c1.Close()
76 76
77 c2, err := net.ListenPacket("udp4", "224.0.0.0:1024") // see RFC 4727 77 c2, err := net.ListenPacket("udp4", "224.0.0.0:1024") // see RFC 4727
78 if err != nil { 78 if err != nil {
79 t.Fatalf("net.ListenPacket failed: %v", err) 79 t.Fatalf("net.ListenPacket failed: %v", err)
80 } 80 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 t.Fatalf("ipv4.RawConn.JoinGroup on %v failed: %v", ifi, err) 235 t.Fatalf("ipv4.RawConn.JoinGroup on %v failed: %v", ifi, err)
236 } 236 }
237 mlt = append(mlt, &ml{r, &ift[i]}) 237 mlt = append(mlt, &ml{r, &ift[i]})
238 } 238 }
239 for _, m := range mlt { 239 for _, m := range mlt {
240 if err := m.c.LeaveGroup(m.ifi, gaddr); err != nil { 240 if err := m.c.LeaveGroup(m.ifi, gaddr); err != nil {
241 t.Fatalf("ipv4.RawConn.LeaveGroup on %v failed: %v", m.i fi, err) 241 t.Fatalf("ipv4.RawConn.LeaveGroup on %v failed: %v", m.i fi, err)
242 } 242 }
243 } 243 }
244 } 244 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b