incominghandshaker

package
v1.12.19 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IncomingHandshaker

type IncomingHandshaker struct {
	Conn       net.Conn
	PeerID     [20]byte
	Extensions [8]byte
	Cipher     mse.CryptoMethod
	Error      error
	// contains filtered or unexported fields
}

IncomingHandshaker does the BitTorrent protocol handshake on an incoming connection.

func New

func New(conn net.Conn) *IncomingHandshaker

New returns a new IncomingHandshaker for a net.Conn.

func (*IncomingHandshaker) Close

func (h *IncomingHandshaker) Close()

Close the IncomingHandshaker. Also closes the underlying connection if there is an ongoing handshake operation.

func (*IncomingHandshaker) Run

func (h *IncomingHandshaker) Run(peerID [20]byte, getSKeyFunc func([20]byte) []byte, checkInfoHashFunc func([20]byte) bool, resultC chan *IncomingHandshaker, timeout time.Duration, ourExtensions [8]byte, forceIncomingEncryption bool)

Run the handshaker goroutine.

Jump to

Keyboard shortcuts

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