handshake

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handshake

type Handshake struct {
	Protocol string
	Reserved []byte
	InfoHash []byte
	PeerID   []byte
}

func InitHandshake

func InitHandshake(rw io.ReadWriter, infoHash []byte, peerID []byte) (*Handshake, error)

InitHandshake sends a handshake message to a stream, then reads and returns a handshake reply

func New

func New(infoHash []byte, peerID []byte) *Handshake

func (*Handshake) Serialize

func (h *Handshake) Serialize() []byte

Jump to

Keyboard shortcuts

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