2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
|
proc ::nano::network::_localIP {version} {
set now [clock seconds]
if {[info exists ::nano::network::_localIP($version)]} {
set cached $::nano::network::_localIP($version)
set lastCheckTime [dict get $cached lastCheckTime]
if {($lastCheckTime + 300) >= $now} {
if {[dict exists $cached value]} {
return [dict get $cached value]
} else {
return -code error "Unable to resolve address for IP $version (cached)"
}
}
}
|
|
|
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
|
proc ::nano::network::_localIP {version} {
set now [clock seconds]
if {[info exists ::nano::network::_localIP($version)]} {
set cached $::nano::network::_localIP($version)
set lastCheckTime [dict get $cached lastCheckTime]
if {[clock add $lastCheckTime 1 day] >= $now} {
if {[dict exists $cached value]} {
return [dict get $cached value]
} else {
return -code error "Unable to resolve address for IP $version (cached)"
}
}
}
|