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

Method writeTo

candidate_base.go:412–426  ·  view source on GitHub ↗
(raw []byte, dst Candidate)

Source from the content-addressed store, hash-verified

410}
411
412func (c *candidateBase) writeTo(raw []byte, dst Candidate) (int, error) {
413 n, err := c.conn.WriteTo(raw, dst.addr())
414 if err != nil {
415 // If the connection is closed, we should return the error
416 if errors.Is(err, io.ErrClosedPipe) {
417 return n, err
418 }
419 c.agent().log.Infof("Failed to send packet: %v", err)
420
421 return n, nil
422 }
423 c.seen(true)
424
425 return n, nil
426}
427
428// TypePreference returns the type preference for this candidate.
429func (c *candidateBase) TypePreference() uint16 {

Callers 1

TestCandidateWriteToFunction · 0.95

Calls 5

agentMethod · 0.95
seenMethod · 0.95
addrMethod · 0.65
WriteToMethod · 0.45
InfofMethod · 0.45

Tested by 1

TestCandidateWriteToFunction · 0.76