Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
6d69ca36
Commit
6d69ca36
authored
Jul 24, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Peer reconnect attempt
parent
a45c08f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
peer.go
peer.go
+12
-2
No files found.
peer.go
View file @
6d69ca36
...
...
@@ -177,10 +177,20 @@ func NewOutboundPeer(addr string, ethereum *Ethereum, caps Caps) *Peer {
// Set up the connection in another goroutine so we don't block the main thread
go
func
()
{
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
addr
,
10
*
time
.
Second
)
var
(
err
error
conn
net
.
Conn
)
for
attempts
:=
0
;
attempts
<
5
;
attempts
++
{
conn
,
err
=
net
.
DialTimeout
(
"tcp"
,
addr
,
10
*
time
.
Second
)
if
err
!=
nil
{
peerlogger
.
Debugf
(
"Peer connection failed. Retrying (%d/5)
\n
"
,
attempts
+
1
)
}
}
if
err
!=
nil
{
peerlogger
.
Debugln
(
"Connection to peer failed"
,
err
)
peerlogger
.
Debugln
(
"Connection to peer failed
. Giving up.
"
,
err
)
p
.
Stop
()
return
}
...
...
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