diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-05 03:26:56 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-05 03:26:56 +0400 |
commit | 32b0f3570237e4d4742fc8874980f2b479c1ae75 (patch) | |
tree | ace6425ecb6170679c36327bbf3694d80d472574 /src/Network/BitTorrent/Core/PeerAddr.hs | |
parent | 1e8a6a7d5267811d035afda764e90092eb0e994c (diff) |
Add Wire module
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerAddr.hs | 8 |
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 | ||
24 | import Control.Applicative | 23 | import 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. | ||
121 | connectToPeer :: PeerAddr -> IO Socket | ||
122 | connectToPeer p = do | ||
123 | sock <- socket AF_INET Stream Network.Socket.defaultProtocol | ||
124 | connect sock (peerSockAddr p) | ||
125 | return sock | ||