diff options
Diffstat (limited to 'src/Network/BitTorrent/Exchange.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Network/BitTorrent/Exchange.hs b/src/Network/BitTorrent/Exchange.hs index 9f119d13..b0a94853 100644 --- a/src/Network/BitTorrent/Exchange.hs +++ b/src/Network/BitTorrent/Exchange.hs | |||
@@ -79,7 +79,8 @@ import Control.Monad.Trans.Resource | |||
79 | 79 | ||
80 | import Data.IORef | 80 | import Data.IORef |
81 | import Data.Conduit as C | 81 | import Data.Conduit as C |
82 | import Data.Conduit.Cereal | 82 | import Data.Conduit.Cereal as S |
83 | import Data.Conduit.Serialization.Binary as B | ||
83 | import Data.Conduit.Network | 84 | import Data.Conduit.Network |
84 | import Data.Serialize as S | 85 | import Data.Serialize as S |
85 | import Text.PrettyPrint as PP hiding (($$)) | 86 | import Text.PrettyPrint as PP hiding (($$)) |
@@ -103,10 +104,12 @@ type PeerWire = ConduitM Message Message IO | |||
103 | 104 | ||
104 | runPeerWire :: Socket -> PeerWire () -> IO () | 105 | runPeerWire :: Socket -> PeerWire () -> IO () |
105 | runPeerWire sock p2p = | 106 | runPeerWire sock p2p = |
106 | sourceSocket sock $= | 107 | sourceSocket sock $= |
107 | conduitGet S.get $= | 108 | S.conduitGet S.get $= |
108 | p2p $= | 109 | -- B.conduitDecode $= |
109 | conduitPut S.put $$ | 110 | p2p $= |
111 | S.conduitPut S.put $$ | ||
112 | -- B.conduitEncode $$ | ||
110 | sinkSocket sock | 113 | sinkSocket sock |
111 | 114 | ||
112 | awaitMessage :: P2P Message | 115 | awaitMessage :: P2P Message |