mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
926f6a3c72
This reverts commit d0ca4447c6c5642830354740d045f453eb3e77e8.
31 lines
747 B
Go
31 lines
747 B
Go
package ice
|
|
|
|
import "fmt"
|
|
|
|
// CandidateRelatedAddress convey transport addresses related to the
|
|
// candidate, useful for diagnostics and other purposes.
|
|
type CandidateRelatedAddress struct {
|
|
Address string
|
|
Port int
|
|
}
|
|
|
|
// String makes CandidateRelatedAddress printable
|
|
func (c *CandidateRelatedAddress) String() string {
|
|
if c == nil {
|
|
return ""
|
|
}
|
|
|
|
return fmt.Sprintf(" related %s:%d", c.Address, c.Port)
|
|
}
|
|
|
|
// Equal allows comparing two CandidateRelatedAddresses.
|
|
// The CandidateRelatedAddress are allowed to be nil.
|
|
func (c *CandidateRelatedAddress) Equal(other *CandidateRelatedAddress) bool {
|
|
if c == nil && other == nil {
|
|
return true
|
|
}
|
|
return c != nil && other != nil &&
|
|
c.Address == other.Address &&
|
|
c.Port == other.Port
|
|
}
|