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
b0e023e4
Commit
b0e023e4
authored
Jun 14, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase ping timeout to 30 seconds
parent
6d52da58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
peer.go
peer.go
+2
-3
No files found.
peer.go
View file @
b0e023e4
...
...
@@ -19,7 +19,7 @@ const (
// Current protocol version
ProtocolVersion
=
20
// Interval for ping/pong message
pingPongTimer
=
1
*
time
.
Second
pingPongTimer
=
2
*
time
.
Second
)
type
DiscReason
byte
...
...
@@ -266,14 +266,13 @@ out:
select
{
// Main message queue. All outbound messages are processed through here
case
msg
:=
<-
p
.
outputQueue
:
p
.
writeMessage
(
msg
)
p
.
lastSend
=
time
.
Now
()
// Ping timer
case
<-
pingTimer
.
C
:
timeSince
:=
time
.
Since
(
time
.
Unix
(
p
.
lastPong
,
0
))
if
!
p
.
pingStartTime
.
IsZero
()
&&
p
.
lastPong
!=
0
&&
timeSince
>
(
pingPongTimer
+
1
0
*
time
.
Second
)
{
if
!
p
.
pingStartTime
.
IsZero
()
&&
p
.
lastPong
!=
0
&&
timeSince
>
(
pingPongTimer
+
3
0
*
time
.
Second
)
{
ethutil
.
Config
.
Log
.
Infof
(
"[PEER] Peer did not respond to latest pong fast enough, it took %s, disconnecting.
\n
"
,
timeSince
)
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