Portability | portable |
---|---|
Stability | experimental |
Maintainer | pxqr.sta@gmail.com |
Safe Haskell | None |
PeerAddr
is used to represent peer address. Currently it's
just peer IP and peer port but this might change in future.
- data PeerAddr = PeerAddr {
- peerID :: !(Maybe PeerId)
- peerIP :: !HostAddress
- peerPort :: !PortNumber
- getCompactPeerList :: Get [PeerAddr]
- peerSockAddr :: PeerAddr -> SockAddr
- connectToPeer :: PeerAddr -> IO Socket
- ppPeer :: PeerAddr -> Doc
Peer address
Peer address info normally extracted from peer list or peer compact list encoding.
PeerAddr | |
|
getCompactPeerList :: Get [PeerAddr]Source
For more info see: http://www.bittorrent.org/beps/bep_0023.html
peerSockAddr :: PeerAddr -> SockAddrSource
Convert peer info from tracker response to socket address. Used for establish connection between peers.
connectToPeer :: PeerAddr -> IO SocketSource
Tries to connect to peer using reasonable default parameters.