bittorrent-0.0.0.3: Bittorrent protocol implementation.

Portabilityportable
Stabilityexperimental
Maintainerpxqr.sta@gmail.com
Safe HaskellNone

Network.BitTorrent.Core.PeerAddr

Contents

Description

PeerAddr is used to represent peer address. Currently it's just peer IP and peer port but this might change in future.

Synopsis

Peer address

data PeerAddr Source

Peer address info normally extracted from peer list or peer compact list encoding.

Constructors

PeerAddr 

Instances

Eq PeerAddr 
Ord PeerAddr 
Show PeerAddr 
Typeable PeerAddr 
ToJSON PeerAddr 
FromJSON PeerAddr 
S.Serialize PeerAddr

The tracker compact peer list compatible encoding. The peerId is always Nothing.

For more info see: http://www.bittorrent.org/beps/bep_0023.html

Pretty PeerAddr 
BEncode PeerAddr

The tracker announce query compatible encoding.

defaultPorts :: [PortNumber]Source

Ports typically reserved for bittorrent P2P listener.

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.