summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Client.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Client.hs')
-rw-r--r--src/Network/BitTorrent/Client.hs40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Client.hs b/src/Network/BitTorrent/Client.hs
new file mode 100644
index 00000000..fc2b904a
--- /dev/null
+++ b/src/Network/BitTorrent/Client.hs
@@ -0,0 +1,40 @@
1module Network.BitTorrent.Client
2 ( Options (..)
3 , Client (..)
4 ) where
5
6import Data.Default
7import Data.Function
8import Data.Ord
9import Data.Text
10import Network
11
12import Data.Torrent
13import Data.Torrent.InfoHash
14import Network.BitTorrent.Core
15import Network.BitTorrent.Exchange.Message
16
17
18data Options = Options
19 { fingerprint :: Fingerprint
20 , name :: Text
21 , port :: PortNumber
22 }
23
24instance Default Options where
25 def = Options
26 { fingerprint = def
27 , name = "hs-bittorrent"
28 , port = 6882
29 }
30
31data Client = Client
32 { clientPeerId :: !PeerId
33 , allowedExtensions :: !Caps
34 }
35
36instance Eq Client where
37 (==) = (==) `on` clientPeerId
38
39instance Ord Client where
40 compare = comparing clientPeerId