summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/DHT/Protocol.hs6
-rw-r--r--src/Network/BitTorrent/Discovery.hs4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/DHT/Protocol.hs b/src/Network/BitTorrent/DHT/Protocol.hs
index 73e5fa68..0ac814b7 100644
--- a/src/Network/BitTorrent/DHT/Protocol.hs
+++ b/src/Network/BitTorrent/DHT/Protocol.hs
@@ -42,7 +42,7 @@ import Network.BitTorrent.Exchange.Protocol ()
42 42
43type NodeId = ByteString 43type NodeId = ByteString
44 44
45-- WARN is the 'system' random suitable for this? 45-- TODO WARN is the 'system' random suitable for this?
46-- | Generate random NodeID used for the entire session. 46-- | Generate random NodeID used for the entire session.
47-- Distribution of ID's should be as uniform as possible. 47-- Distribution of ID's should be as uniform as possible.
48-- 48--
@@ -56,9 +56,7 @@ data NodeAddr = NodeAddr {
56 56
57instance Serialize NodeAddr where 57instance Serialize NodeAddr where
58 get = NodeAddr <$> getWord32be <*> get 58 get = NodeAddr <$> getWord32be <*> get
59 put NodeAddr {..} = do 59 put NodeAddr {..} = putWord32be nodeIP >> put nodePort
60 putWord32be nodeIP
61 put nodePort
62 60
63data NodeInfo = NodeInfo { 61data NodeInfo = NodeInfo {
64 nodeID :: !NodeId 62 nodeID :: !NodeId
diff --git a/src/Network/BitTorrent/Discovery.hs b/src/Network/BitTorrent/Discovery.hs
new file mode 100644
index 00000000..f26864a7
--- /dev/null
+++ b/src/Network/BitTorrent/Discovery.hs
@@ -0,0 +1,4 @@
1type PeerCount = Int
2
3defaultChanSize :: PeerCount
4defaultChanSize = defaultNumWant * 2