MCPcopy Create free account
hub / github.com/pion/ice / WithBindingRequestHandler

Function WithBindingRequestHandler

agent_options.go:778–790  ·  view source on GitHub ↗

WithBindingRequestHandler sets a handler to allow applications to perform logic on incoming STUN Binding Requests. This was implemented to allow users to: - Log incoming Binding Requests for debugging - Implement draft-thatcher-ice-renomination - Implement custom CandidatePair switching logic Examp

(
	handler func(m *stun.Message, local, remote Candidate, pair *CandidatePair) bool,
)

Source from the content-addressed store, hash-verified

776// }
777// agent, err := NewAgentWithOptions(WithBindingRequestHandler(handler))
778func WithBindingRequestHandler(
779 handler func(m *stun.Message, local, remote Candidate, pair *CandidatePair) bool,
780) AgentOption {
781 return func(a *Agent) error {
782 if a.constructed {
783 return ErrAgentOptionNotUpdatable
784 }
785
786 a.userBindingRequestHandler = handler
787
788 return nil
789 }
790}
791
792// WithEnableUseCandidateCheckPriority enables checking for equal or higher priority when
793// switching selected candidate pair if the peer requests USE-CANDIDATE and agent is a lite agent.

Callers 3

TestAgentUpdateOptionsFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestAgentUpdateOptionsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…