示例#1
0
文件: meta.go 项目: chendx79/gafka
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)
}
示例#2
0
文件: meta.go 项目: funkygao/gafka
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
}