Documentation
¶
Index ¶
- func CreateListener(flags *conf.Flags) (listener net.Listener, externalPort int, err error)
- func CreatePortMapping(flags *conf.Flags) (translate nat.NAT, err error)
- func ListenForPeerConnections(flags *conf.Flags) (conChan chan *BtConn, listenPort int, err error)
- func ReadHeader(conn net.Conn) (h []byte, err error)
- type BtConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateListener ¶
func CreatePortMapping ¶
createPortMapping creates a NAT port mapping, or nil if none requested or found.
func ListenForPeerConnections ¶
ListenForPeerConnections listens on a TCP port for incoming connections and demuxes them to the appropriate active torrentSession based on the InfoHash in the header.
Types ¶
type BtConn ¶
type BtConn struct { Conn net.Conn RemoteAddr net.Addr Infohash string // contains filtered or unexported fields }
btConn wraps an incoming network connection and contains metadata that helps identify which active torrentSession it's relevant for.
func (*BtConn) ReadHeader ¶
Click to show internal directories.
Click to hide internal directories.