]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Tracker.hs
refactor: remove peerid from Peer datatype
[functorrent.git] / src / FuncTorrent / Tracker.hs
index 9873fe1513f073f05efe79b97b2e9bae1522e75e..8090feb99ea868eb328dc1811332b550984e277c 100644 (file)
@@ -38,7 +38,7 @@ import qualified FuncTorrent.Tracker.Udp as UT (trackerLoop)
 import FuncTorrent.Tracker.Types (TState(..), TrackerEventState(..), TrackerProtocol(..), TrackerMsg(..))
 import FuncTorrent.Utils (Port, toPort, getHostname)
 import qualified FuncTorrent.FileSystem as FS (MsgChannel)
-import FuncTorrent.Peer (Peer)
+import FuncTorrent.PeerMsgs (Peer)
 
 type MsgChannel = Chan TrackerMsg
 
@@ -61,6 +61,7 @@ runTracker msgChannel fsChan infohash port peerId announceList sz = do
       return ()
     Udp -> do
       _ <- forkIO $ UT.trackerLoop turl (fromIntegral port) peerId infohash fsChan initialTState
+      runStateT (msgHandler msgChannel) initialTState
       return ()
     _ ->
       error "Tracker Protocol unimplemented"