Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
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
golang
Commits
ae7a8434
Commit
ae7a8434
authored
Mar 07, 2012
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: use IANA reserved port to test dial timeout
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5757060
parent
4267974c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
dial_test.go
src/pkg/net/dial_test.go
+5
-2
No files found.
src/pkg/net/dial_test.go
View file @
ae7a8434
...
...
@@ -51,12 +51,15 @@ func TestDialTimeout(t *testing.T) {
// to connecting to a hopefully-dead 127/8 address.
// Same for windows.
//
// Use a
bogus port (44444
) instead of 80, because
// Use a
n IANA reserved port (49151
) 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.
//
// IANA Service Name and Transport Protocol Port Number Registry
// <http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml>
go
func
()
{
c
,
err
:=
DialTimeout
(
"tcp"
,
"127.0.71.111:4
4444
"
,
200
*
time
.
Millisecond
)
c
,
err
:=
DialTimeout
(
"tcp"
,
"127.0.71.111:4
9151
"
,
200
*
time
.
Millisecond
)
if
err
==
nil
{
err
=
fmt
.
Errorf
(
"unexpected: connected to %s!"
,
c
.
RemoteAddr
())
c
.
Close
()
...
...
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