Skip to content

Commit

Permalink
Update the docstring for PacketServe.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Nov 28, 2024
1 parent 1eeb4d6 commit 08e8bba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions service/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ func (h *associationHandler) SetTargetConnFactory(factory func() (net.PacketConn

type AssocationHandleFunc func(assocation net.Conn)

// PacketServe listens for packets and calls `handle` to handle them until the connection
// returns [ErrClosed].
// PacketServe listens for UDP packets on the provided [net.PacketConn], creates
// creates and manages NAT associations, and invokes the provided `handle`
// function for each association. It uses a NAT map to track active associations
// and handles their lifecycle.
func PacketServe(clientConn net.PacketConn, handle AssocationHandleFunc, metrics NATMetrics) {
nm := newNATmap()
defer nm.Close()
Expand Down

0 comments on commit 08e8bba

Please sign in to comment.