小编Siy*_*new的帖子

OKHTTP 无法解析主机 没有与主机名关联的地址

我们发布了一个移动应用程序,我们的一些用户无法连接到我们的应用程序。首先,我们猜测这是 dns 问题,因此我们将 DNS 从 Digital Ocean 更改为 Cloudflare,但它没有解决任何问题。在 Android 设备上,我们使用 Retrofit 2.4 连接到我们的服务器。但是我们的一些用户无法连接到服务器,但他们在服务器上可以 ping 并且可以在浏览器中打开网站,但他们只能使用 vpn 连接。

我们从 firebase 得到这个异常,我们使用Retrofit 2.4.0and OKHTTP 3.10.0。他们在 github 或网上的问题中没有任何内容。

Non-fatal Exception: java.net.UnknownHostException
Unable to resolve host "jomlex.com": No address associated with hostname
java.net.Inet6AddressImpl.lookupHostByName (Inet6AddressImpl.java:125)
java.net.InetAddress.getAllByName (InetAddress.java:752)
okhttp3.Dns$1.lookup (Dns.java:40)
okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:185)
okhttp3.internal.connection.RouteSelector.nextProxy (RouteSelector.java:149)
okhttp3.internal.connection.RouteSelector.next (RouteSelector.java:84)
okhttp3.internal.connection.StreamAllocation.findConnection (StreamAllocation.java:214)
okhttp3.internal.connection.StreamAllocation.findHealthyConnection (StreamAllocation.java:135)
okhttp3.internal.connection.StreamAllocation.newStream (StreamAllocation.java:114)
okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.java:42)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:93)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:93)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:126)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
okhttp3.internal.http.RealInterceptorChain.proceed …
Run Code Online (Sandbox Code Playgroud)

android retrofit2 okhttp3

8
推荐指数
0
解决办法
5055
查看次数

在python3中查找字符串中有一个表情符号

我想使用Python 3 is_emoji检查字符串是否只包含一个表情符号.例如,有一个函数检查字符串是否只有一个表情符号.

def is_emoji(s):
    pass

is_emoji("") #True
is_emoji("??") #False
Run Code Online (Sandbox Code Playgroud)

我尝试使用正则表达式但emojis没有固定长度.例如:

print(len("??".encode("utf-8"))) # 6 
print(len("".encode("utf-8"))) # 4
Run Code Online (Sandbox Code Playgroud)

python python-3.x emoji

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×1

emoji ×1

okhttp3 ×1

python ×1

python-3.x ×1

retrofit2 ×1