2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Doc comments

This commit is contained in:
Matt Joiner 2021-11-22 18:06:27 +11:00
parent 357896fb65
commit 8555ab7f21
3 changed files with 9 additions and 2 deletions

View 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

View 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

View 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