From 8555ab7f2142b7f5832f3a205cee547091370318 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 22 Nov 2021 18:06:27 +1100 Subject: [PATCH] Doc comments --- tracker/udp/client.go | 2 ++ tracker/udp/conn-client.go | 8 ++++++-- tracker/udp/dispatcher.go | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tracker/udp/client.go b/tracker/udp/client.go index aea3ec91..8b072e62 100644 --- a/tracker/udp/client.go +++ b/tracker/udp/client.go @@ -11,6 +11,8 @@ import ( "time" ) +// Client interacts with UDP trackers via its Writer and Dispatcher. It has no knowledge of +// connection specifics. type Client struct { mu sync.Mutex connId ConnectionId diff --git a/tracker/udp/conn-client.go b/tracker/udp/conn-client.go index ac920ed0..81e139c9 100644 --- a/tracker/udp/conn-client.go +++ b/tracker/udp/conn-client.go @@ -9,11 +9,15 @@ import ( ) type NewConnClientOpts struct { + // The network to operate to use, such as "udp4", "udp", "udp6". Network string - Host string - Ipv6 *bool + // Tracker address + Host string + // If non-nil, forces either IPv4 or IPv6 in the UDP tracker wire protocol. + Ipv6 *bool } +// Manages a Client with a specific connection. type ConnClient struct { Client Client conn net.Conn diff --git a/tracker/udp/dispatcher.go b/tracker/udp/dispatcher.go index 3aad927e..7fc3e1b3 100644 --- a/tracker/udp/dispatcher.go +++ b/tracker/udp/dispatcher.go @@ -6,6 +6,7 @@ import ( "sync" ) +// Maintains a mapping of transaction IDs to handlers. type Dispatcher struct { mu sync.RWMutex transactions map[TransactionId]Transaction -- 2.44.0