summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Exchange/Message.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-11 02:47:45 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-11 02:47:45 +0400
commit772e0d6974f955465345fd3055a3ffde71282a4d (patch)
tree3a512137097e21ad7d4286c0f11d0213784dd510 /src/Network/BitTorrent/Exchange/Message.hs
parent38c1f019d4fdb0fa776c7364d28a2cc96d570bb3 (diff)
Add defaultKeepAliveTimeout constant
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Message.hs')
-rw-r--r--src/Network/BitTorrent/Exchange/Message.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Message.hs b/src/Network/BitTorrent/Exchange/Message.hs
index 335a9050..f848f4cb 100644
--- a/src/Network/BitTorrent/Exchange/Message.hs
+++ b/src/Network/BitTorrent/Exchange/Message.hs
@@ -54,6 +54,7 @@ module Network.BitTorrent.Exchange.Message
54 54
55 -- * Messages 55 -- * Messages
56 , Message (..) 56 , Message (..)
57 , defaultKeepAliveTimeout
57 , defaultKeepAliveInterval 58 , defaultKeepAliveInterval
58 , PeerMessage (..) 59 , PeerMessage (..)
59 60
@@ -982,9 +983,15 @@ instance PeerMessage PortNumber where
982 requires _ = Just ExtDHT 983 requires _ = Just ExtDHT
983 {-# INLINE requires #-} 984 {-# INLINE requires #-}
984 985
985-- | In seconds. 986-- | How long /this/ peer should wait before dropping connection, in
987-- seconds.
988defaultKeepAliveTimeout :: Int
989defaultKeepAliveTimeout = 2 * 60
990
991-- | How often /this/ peer should send 'KeepAlive' messages, in
992-- seconds.
986defaultKeepAliveInterval :: Int 993defaultKeepAliveInterval :: Int
987defaultKeepAliveInterval = 2 * 60 994defaultKeepAliveInterval = 60
988 995
989getInt :: S.Get Int 996getInt :: S.Get Int
990getInt = fromIntegral <$> S.getWord32be 997getInt = fromIntegral <$> S.getWord32be