summaryrefslogtreecommitdiff
path: root/examples/Main.hs
blob: ef12cc701c5ecb998078160d96f2086947cba810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Main (main) where

import Control.Concurrent
import Network.BitTorrent
import Network.BitTorrent.Sessions
import System.Environment

main :: IO ()
main = do
  [path]  <- getArgs
  torrent <- fromFile path
  print (contentLayout "./" (tInfo torrent))
  let loc = TorrentLoc path "/tmp"

  withDefaultClient (head defaultPorts) 3000 $ \ client -> do
    openSwarmSession client loc
    threadDelay 1000000000000
    return ()