diff options
author | Felix Lange <fjl@twurst.com> | 2015-05-22 21:38:17 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-05-25 07:17:14 +0800 |
commit | 9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a (patch) | |
tree | 0798c566ec382ecc06dcb8c86e79d0156f599ead /p2p | |
parent | 1440f9a37a8baf67b989ddf0b8cc30c9a1970e14 (diff) | |
download | dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.tar dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.tar.gz dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.tar.bz2 dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.tar.lz dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.tar.xz dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.tar.zst dexon-9e1fd70b50dc2f545b0875bb06c93f6ccfa8962a.zip |
p2p: decrease frameReadTimeout to 30s
This detects hanging connections sooner. We send a ping every 15s and
other implementation have similar limits.
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/server.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/p2p/server.go b/p2p/server.go index 27e617610..af08380e1 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -25,10 +25,11 @@ const ( // Maximum number of concurrently dialing outbound connections. maxActiveDialTasks = 16 - // maximum time allowed for reading a complete message. - // this is effectively the amount of time a connection can be idle. - frameReadTimeout = 1 * time.Minute - // maximum amount of time allowed for writing a complete message. + // Maximum time allowed for reading a complete message. + // This is effectively the amount of time a connection can be idle. + frameReadTimeout = 30 * time.Second + + // Maximum amount of time allowed for writing a complete message. frameWriteTimeout = 5 * time.Second ) |