forked from External/ergo
add a login timout to close dropped connections
This commit is contained in:
parent
6e0ab99d38
commit
965d8efdf8
4 changed files with 26 additions and 23 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue