update version
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package com.mogo.cloud.httpdns
|
||||
|
||||
import com.mogo.cloud.httpdns.listener.IMogoHttpDns
|
||||
import java.lang.IllegalStateException
|
||||
|
||||
|
||||
object MogoHttpDnsClient : IMogoHttpDns {
|
||||
private var httpDnsHelper:HttpDnsHelper? = null
|
||||
private var httpDnsHelper: HttpDnsHelper? = null
|
||||
|
||||
fun init(config: MogoHttpDnsConfig) {
|
||||
if(httpDnsHelper == null) {
|
||||
// httpdns init
|
||||
if (httpDnsHelper == null) {
|
||||
httpDnsHelper = HttpDnsHelper(config)
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ object MogoHttpDnsClient : IMogoHttpDns {
|
||||
/**
|
||||
* 先从本地缓存中根据type和host获取ip:port,如果本地缓存中没有,再通过网络获取
|
||||
*/
|
||||
fun getHttpDnsAddressUseCacheIfNecessary(type: Int, _host: String):String?{
|
||||
fun getHttpDnsAddressUseCacheIfNecessary(type: Int, _host: String): String? {
|
||||
return getHttpDnsCachedAddress(type, _host) ?: return getHttpDnsAddress(type, _host)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ object MogoHttpDnsClient : IMogoHttpDns {
|
||||
if (httpDnsHelper == null) {
|
||||
throw IllegalStateException("MogoHttpDnsClient init error")
|
||||
}
|
||||
return httpDnsHelper!!.getHttpDnsAddress(type,_host)
|
||||
return httpDnsHelper!!.getHttpDnsAddress(type, _host)
|
||||
}
|
||||
|
||||
override fun getHttpDnsCachedAddress(type: Int, _host: String): String? {
|
||||
|
||||
Reference in New Issue
Block a user