- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
没有javadoc。谁能帮忙解释一下 GaiException 的“Gai”到底是什么意思?以及“EAI”?
最佳答案
GaiException.java
的第 22-27 行文件状态如下:
/** An unchecked exception thrown when the {@link Os} {@code getaddrinfo} or {@code getnameinfo} * methods fail. This exception contains the native error value, for comparison against the * {@code GAI_} constants in {@link OsConstants}, should sophisticated * callers need to adjust their behavior based on the exact failure. */
根据@code getaddrinfo
的措辞,它看起来像是获取地址信息的意思。
操作系统界面
getaddrinfo
方法在 Os.java
中定义第 50 行的接口(interface)文件:
public InetAddress[] getaddrinfo(String node, StructAddrinfo hints) throws GaiException;
操作系统接口(interface)实现
然后在ForwardingOs.java
中实现了getaddrinfo
方法(通过Os 接口(interface))第 59 行:
public InetAddress[] getaddrinfo(String node, StructAddrinfo hints) throws GaiException {
return os.getaddrinfo(node, hints);
}
来自 ForwardingOs.java
的功能然后由 BlockGuardOs.java 继承类(并且没有被覆盖)
关于android - GaiException 和 EAI 的 "Gai"代表什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30804350/
没有javadoc。谁能帮忙解释一下 GaiException 的“Gai”到底是什么意思?以及“EAI”? https://android.googlesource.com/platform/lib
我是一名优秀的程序员,十分优秀!