gpt4 book ai didi

ios - AF网络可达性ForLocalWiFi

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:36:40 24 4
gpt4 key购买 nike

有没有办法让 AFNetworking 2 等同于

[Reachability reachabilityForLocalWiFi];

最佳答案

我查看了 Apple 可达性代码,我认为这可以完成工作。

- (AFNetworkReachabilityManager*) reachabilityForLocalWifi
{
struct sockaddr_in localWifiAddress;
bzero(&localWifiAddress, sizeof(localWifiAddress));
localWifiAddress.sin_len = sizeof(localWifiAddress);
localWifiAddress.sin_family = AF_INET;

// IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0.
localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);

return [AFNetworkReachabilityManager managerForAddress:&localWifiAddress];
}

关于ios - AF网络可达性ForLocalWiFi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21684413/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com