mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-19 13:19:06 +02:00
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.
37 lines
942 B
Go
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
|
|
}
|