core

package
v0.0.0-...-e00f62a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2017 License: MIT Imports: 11 Imported by: 0

README

BitTorrent protocol implementation files

  • PWP
  • THP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionStatus

type ConnectionStatus struct {
	HandshakeComplete bool // NOT USED
}

type PWPNode

type PWPNode struct {
	// contains filtered or unexported fields
}

func NewPWPNode

func NewPWPNode(peerAddress string, log *logging.Logger) *PWPNode

func (*PWPNode) Connect

func (n *PWPNode) Connect(peerAddress string) error

func (*PWPNode) Listen

func (n *PWPNode) Listen()

func (*PWPNode) Send

func (n *PWPNode) Send(data interface{}) error

type PWPStatus

type PWPStatus struct {
	AmChoking      bool
	AmInterested   bool
	PeerChoking    bool
	PeerInterested bool
}

type ReceiveWorker

type ReceiveWorker struct {
	// contains filtered or unexported fields
}

func NewReceiveWorker

func NewReceiveWorker(reader bencode.BencodeReader, recvChan chan []byte, log *logging.Logger) *ReceiveWorker

func (*ReceiveWorker) Start

func (w *ReceiveWorker) Start()

type TorrentSession

type TorrentSession struct {
	PWPStatus        PWPStatus
	ConnectionStatus *ConnectionStatus
	// contains filtered or unexported fields
}

func NewTorrentSession

func NewTorrentSession(connection net.Conn, log *logging.Logger) *TorrentSession

func (*TorrentSession) AwaitHandshake

func (s *TorrentSession) AwaitHandshake() bool

func (*TorrentSession) Close

func (s *TorrentSession) Close()

func (*TorrentSession) GetConnection

func (s *TorrentSession) GetConnection() net.Conn

func (*TorrentSession) Receive

func (s *TorrentSession) Receive(conn net.Conn) (string, error)

func (*TorrentSession) Send

func (s *TorrentSession) Send(data interface{}) error

func (*TorrentSession) SendMessage

func (s *TorrentSession) SendMessage(msg message.PWPMessage) error

func (*TorrentSession) Start

func (s *TorrentSession) Start()

func (*TorrentSession) StartHandshake

func (s *TorrentSession) StartHandshake() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL