Files
netbird/client/internal/peer/worker/event.go
T
Zoltán Papp b1098cad94 [client] Route Pion ICE events through the peer event loop
Queue Pion state, candidate and selected-pair notifications together with ICE dial results. Move worker state updates to the peer event loop and expose atomic snapshots to signaling and the reconnection guard.

Keep the existing session ownership checks and disconnect behavior. Release dial results when the mailbox cannot deliver them.
2026-09-10 03:08:00 +02:00

37 lines
942 B
Go

package worker
import (
"net"
"github.com/pion/ice/v4"
icemaker "github.com/netbirdio/netbird/client/internal/peer/ice"
"github.com/netbirdio/netbird/client/internal/peer/signaling"
)
// ICEStateChanged carries a Pion notification to the Conn event loop.
type ICEStateChanged struct {
Agent *icemaker.ThreadSafeAgent
State ice.ConnectionState
}
// ICECandidate carries a gathered candidate, or nil when gathering finishes.
type ICECandidate struct {
Candidate ice.Candidate
}
// ICESelectedPair carries Pion's selected candidate pair notification.
type ICESelectedPair struct {
Agent *icemaker.ThreadSafeAgent
Local, Remote ice.Candidate
}
// ICEDialDone transfers the dial result to the event loop. The producer closes
// Conn if posting fails; otherwise the consumer owns it, including on errors.
type ICEDialDone struct {
Agent *icemaker.ThreadSafeAgent
Conn net.Conn
Offer signaling.OfferAnswer
Err error
}