udpTrackerServer

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSimple

func RunSimple(ctx context.Context, s *Server, pc net.PacketConn, family udp.AddrFamily) error

Types

type AnnounceTracker

type AnnounceTracker = trackerServer.AnnounceTracker

type ConnectionTracker

type ConnectionTracker interface {
	Add(ctx context.Context, addr ConnectionTrackerAddr, id udp.ConnectionId) error
	Check(ctx context.Context, addr ConnectionTrackerAddr, id udp.ConnectionId) (bool, error)
}

type ConnectionTrackerAddr

type ConnectionTrackerAddr = string

type InfoHash

type InfoHash = [20]byte

type RequestSourceAddr

type RequestSourceAddr = net.Addr

type Server

type Server struct {
	ConnTracker  ConnectionTracker
	SendResponse func(ctx context.Context, data []byte, addr net.Addr) (int, error)
	Announce     *trackerServer.AnnounceHandler
}

func (*Server) HandleRequest

func (me *Server) HandleRequest(
	ctx context.Context,
	family udp.AddrFamily,
	source RequestSourceAddr,
	body []byte,
) (err error)

Jump to

Keyboard shortcuts

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