1
0
Fork 0
forked from External/ergo

add a login timout to close dropped connections

This commit is contained in:
Jeremy Latt 2014-02-13 13:19:26 -08:00
parent 6e0ab99d38
commit 965d8efdf8
4 changed files with 26 additions and 23 deletions

View file

@ -5,13 +5,17 @@ import (
"strings"
)
func AddrLookupHostname(addr net.Addr) string {
func IPString(addr net.Addr) string {
addrStr := addr.String()
ipaddr, _, err := net.SplitHostPort(addrStr)
if err != nil {
return addrStr
}
return LookupHostname(ipaddr)
return ipaddr
}
func AddrLookupHostname(addr net.Addr) string {
return LookupHostname(IPString(addr))
}
func LookupHostname(addr string) string {