From c1e3c9762eb5fea16188a0fb21ad01dd3240ab88 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sun, 15 Dec 2013 19:44:12 +0400 Subject: Fix bugs in PeerAddr encoding. Also: * PeerAddr.hs internals and export list have been simplified; * tests added. --- src/Network/BitTorrent/Exchange/Wire.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Network/BitTorrent/Exchange/Wire.hs') diff --git a/src/Network/BitTorrent/Exchange/Wire.hs b/src/Network/BitTorrent/Exchange/Wire.hs index 27b4be12..2a7d2aeb 100644 --- a/src/Network/BitTorrent/Exchange/Wire.hs +++ b/src/Network/BitTorrent/Exchange/Wire.hs @@ -505,7 +505,7 @@ initiateHandshake sock hs = do recvHandshake sock -- | Tries to connect to peer using reasonable default parameters. -connectToPeer :: (IPAddress i) => PeerAddr i -> IO Socket +connectToPeer :: PeerAddr IP -> IO Socket connectToPeer p = do sock <- socket AF_INET Stream Network.Socket.defaultProtocol connect sock (peerSockAddr p) @@ -628,7 +628,7 @@ reconnect = undefined -- -- This function can throw 'WireFailure' exception. -- -connectWire :: (IPAddress i) => Handshake -> PeerAddr i -> ExtendedCaps -> Wire () -> IO () +connectWire :: Handshake -> PeerAddr IP -> ExtendedCaps -> Wire () -> IO () connectWire hs addr extCaps wire = bracket (connectToPeer addr) close $ \ sock -> do hs' <- initiateHandshake sock hs -- cgit v1.2.3