Example #1
0
func (this *BrokerInfo) NamedAddr() string {
	dns, present := ctx.ReverseDnsLookup(this.Host, this.Port)
	if !present {
		return this.Addr()
	}

	return fmt.Sprintf("%s:%d", dns, this.Port)
}
Example #2
0
func (this *BrokerZnode) NamedAddr() (string, bool) {
	dns, present := ctx.ReverseDnsLookup(this.Host, this.Port)
	if !present {
		return this.Addr(), false
	}

	return fmt.Sprintf("%s:%d", dns, this.Port), true
}