diff options
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Message.hs | 11 |
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. | ||
988 | defaultKeepAliveTimeout :: Int | ||
989 | defaultKeepAliveTimeout = 2 * 60 | ||
990 | |||
991 | -- | How often /this/ peer should send 'KeepAlive' messages, in | ||
992 | -- seconds. | ||
986 | defaultKeepAliveInterval :: Int | 993 | defaultKeepAliveInterval :: Int |
987 | defaultKeepAliveInterval = 2 * 60 | 994 | defaultKeepAliveInterval = 60 |
988 | 995 | ||
989 | getInt :: S.Get Int | 996 | getInt :: S.Get Int |
990 | getInt = fromIntegral <$> S.getWord32be | 997 | getInt = fromIntegral <$> S.getWord32be |