summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Core/PeerAddr.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-05 03:26:56 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-05 03:26:56 +0400
commit32b0f3570237e4d4742fc8874980f2b479c1ae75 (patch)
treeace6425ecb6170679c36327bbf3694d80d472574 /src/Network/BitTorrent/Core/PeerAddr.hs
parent1e8a6a7d5267811d035afda764e90092eb0e994c (diff)
Add Wire module
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs')
-rw-r--r--src/Network/BitTorrent/Core/PeerAddr.hs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs
index ed2dc672..81754e5e 100644
--- a/src/Network/BitTorrent/Core/PeerAddr.hs
+++ b/src/Network/BitTorrent/Core/PeerAddr.hs
@@ -18,7 +18,6 @@ module Network.BitTorrent.Core.PeerAddr
18 PeerAddr(..) 18 PeerAddr(..)
19 , defaultPorts 19 , defaultPorts
20 , peerSockAddr 20 , peerSockAddr
21 , connectToPeer
22 ) where 21 ) where
23 22
24import Control.Applicative 23import Control.Applicative
@@ -116,10 +115,3 @@ peerSockAddr = SockAddrInet <$> (g . peerPort) <*> (htonl . peerIP)
116 115
117 g :: PortNumber -> PortNumber 116 g :: PortNumber -> PortNumber
118 g = id 117 g = id
119
120-- | Tries to connect to peer using reasonable default parameters.
121connectToPeer :: PeerAddr -> IO Socket
122connectToPeer p = do
123 sock <- socket AF_INET Stream Network.Socket.defaultProtocol
124 connect sock (peerSockAddr p)
125 return sock