Documentation
¶
Index ¶
- type Client
- func (c *Client) Handshake() error
- func (c *Client) Read() (*message.Message, error)
- func (c *Client) SendHave(index int) error
- func (c *Client) SendInterested() error
- func (c *Client) SendNotInterested() error
- func (c *Client) SendRequest(index, begin, length int) error
- func (c *Client) SendUnchoke() error
- type ClientInitiatedSelection
- type ClientSelection
- type MPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Conn packets.UDPConn Choked bool Bitfield bitfield.Bitfield Peer peers.Peer InfoHash [20]byte PeerID [20]byte DiscoveryConfig *config.PeerDiscoveryConfig DhtNode *dht_node.DhtNode }
A Client is a TCP connection with a peer
func (*Client) SendInterested ¶
SendInterested sends an Interested message to the peer
func (*Client) SendNotInterested ¶
SendNotInterested sends a NotInterested message to the peer
func (*Client) SendRequest ¶
SendRequest sends a Request message to the peer
func (*Client) SendUnchoke ¶
SendUnchoke sends an Unchoke message to the peer
type ClientInitiatedSelection ¶
type ClientInitiatedSelection struct {
// contains filtered or unexported fields
}
LastSelection users could add more fields
func (*ClientInitiatedSelection) CustomPathSelectAlg ¶
func (lastSel *ClientInitiatedSelection) CustomPathSelectAlg(pathSet *pathselection.PathSet) (*pathselection.PathSet, error)
CustomPathSelectAlg this is where the user actually wants to implement its logic in
type ClientSelection ¶
type ClientSelection struct {
// contains filtered or unexported fields
}
LastSelection users could add more fields
func (*ClientSelection) CustomPathSelectAlg ¶
func (lastSel *ClientSelection) CustomPathSelectAlg(pathSet *pathselection.PathSet) (*pathselection.PathSet, error)
CustomPathSelectAlg this is where the user actually wants to implement its logic in
type MPClient ¶
type MPClient struct { Client // contains filtered or unexported fields }
func NewMPClient ¶
func NewMPClient() *MPClient
func (*MPClient) DialAndWaitForConnectBack ¶
func (*MPClient) GetSocket ¶
func (mp *MPClient) GetSocket() *smp.MPPeerSock
func (*MPClient) WaitForNewClient ¶
Click to show internal directories.
Click to hide internal directories.