return 0
_ -> return 0
-announceRequest :: Word64 -> ByteString -> Word64 -> Word64 -> Word64 -> Word16 -> ReaderT UDPTrackerHandle IO Word32
-announceRequest cid infohash up down left port = do
+announceRequest :: Word64 -> ByteString -> String -> Word64 -> Word64 -> Word64 -> Word16 -> ReaderT UDPTrackerHandle IO Word32
+announceRequest cid infohash peerId up down left port = do
h <- ask
tidi <- liftIO randomIO
-- connId transId infohash peerId down left up event port)
- let pkt = encode $ AnnounceReq cid tidi infohash "foo" down left up None port
+ let pkt = encode $ AnnounceReq cid tidi infohash peerId down left up None port
liftIO $ sendRequest h (toStrict pkt)
return tidi
t1 <- connectRequest
cid <- connectResponse t1
liftIO $ print cid
- t2 <- announceRequest cid infohash (fromIntegral up) (fromIntegral down) (fromIntegral (left tstate)) (fromIntegral sport)
+ t2 <- announceRequest cid infohash peerId (fromIntegral up) (fromIntegral down) (fromIntegral (left tstate)) (fromIntegral sport)
stats <- announceResponse t2
liftIO $ print stats