Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
net
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
net
Commits
28323391
Commit
28323391
authored
Dec 21, 2012
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go.net/ipv4: update doc
R=golang-dev, dave CC=golang-dev
https://golang.org/cl/6996045
parent
0e4f6eb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
doc.go
ipv4/doc.go
+3
-3
mocktransponder_test.go
ipv4/mocktransponder_test.go
+4
-4
No files found.
ipv4/doc.go
View file @
28323391
...
...
@@ -110,7 +110,7 @@
//
// b := make([]byte, 1500)
// for {
// n, cm, src, err := p.Read(b)
// n, cm, src, err := p.Read
From
(b)
// if err != nil {
// // error handling
// }
...
...
@@ -127,7 +127,7 @@
//
// p.SetTOS(ipv4.DSCP_CS0)
// p.SetTTL(16)
// _, err = p.Write(data, nil, src)
// _, err = p.Write
To
(data, nil, src)
// if err != nil {
// // error handling
// }
...
...
@@ -138,7 +138,7 @@
// // error handling
// }
// p.SetMulticastTTL(2)
// _, err = p.Write(data, nil, dst)
// _, err = p.Write
To
(data, nil, dst)
// if err != nil {
// // error handling
// }
...
...
ipv4/mocktransponder_test.go
View file @
28323391
...
...
@@ -38,11 +38,11 @@ func runPayloadTransponder(t *testing.T, c *ipv4.PacketConn, wb []byte, dst net.
}
c
.
SetDeadline
(
time
.
Now
()
.
Add
(
100
*
time
.
Millisecond
))
if
_
,
err
:=
c
.
WriteTo
(
wb
,
nil
,
dst
);
err
!=
nil
{
t
.
Fatalf
(
"ipv4.PacketConn.Write failed: %v"
,
err
)
t
.
Fatalf
(
"ipv4.PacketConn.Write
To
failed: %v"
,
err
)
}
_
,
cm
,
_
,
err
:=
c
.
ReadFrom
(
rb
)
if
err
!=
nil
{
t
.
Fatalf
(
"ipv4.PacketConn.Read failed: %v"
,
err
)
t
.
Fatalf
(
"ipv4.PacketConn.Read
From
failed: %v"
,
err
)
}
t
.
Logf
(
"rcvd cmsg: %v"
,
cm
)
}
...
...
@@ -73,11 +73,11 @@ func runDatagramTransponder(t *testing.T, c *ipv4.RawConn, wb []byte, src, dst n
}
c
.
SetDeadline
(
time
.
Now
()
.
Add
(
100
*
time
.
Millisecond
))
if
err
:=
c
.
WriteTo
(
wh
,
wb
,
nil
);
err
!=
nil
{
t
.
Fatalf
(
"ipv4.RawConn.Write failed: %v"
,
err
)
t
.
Fatalf
(
"ipv4.RawConn.Write
To
failed: %v"
,
err
)
}
rh
,
_
,
cm
,
err
:=
c
.
ReadFrom
(
rb
)
if
err
!=
nil
{
t
.
Fatalf
(
"ipv4.RawConn.Read failed: %v"
,
err
)
t
.
Fatalf
(
"ipv4.RawConn.Read
From
failed: %v"
,
err
)
}
t
.
Logf
(
"rcvd cmsg: %v"
,
cm
.
String
())
t
.
Logf
(
"rcvd hdr: %v"
,
rh
.
String
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment