| 410 | } |
| 411 | |
| 412 | func (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. |
| 429 | func (c *candidateBase) TypePreference() uint16 { |