]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Doc comments
authorMatt Joiner <anacrolix@gmail.com>
Mon, 22 Nov 2021 07:06:27 +0000 (18:06 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 22 Nov 2021 07:10:47 +0000 (18:10 +1100)
tracker/udp/client.go
tracker/udp/conn-client.go
tracker/udp/dispatcher.go

index aea3ec91fe69f5c552f4ba5259a30dc77778918a..8b072e62fef4b8db7b3027814ce7da4cb8a98293 100644 (file)
@@ -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
index ac920ed099d8aa4df2e4cd9edc6644b8dadb40c6..81e139c96151fbd856d95b5bd528a9456193e1db 100644 (file)
@@ -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
index 3aad927e3848bfb5cbe742cd1c294ea4b6e9790a..7fc3e1b346e68c88d9523ff89294242ac758a4b2 100644 (file)
@@ -6,6 +6,7 @@ import (
        "sync"
 )
 
+// Maintains a mapping of transaction IDs to handlers.
 type Dispatcher struct {
        mu           sync.RWMutex
        transactions map[TransactionId]Transaction