iOS 开发实用技术导航
NSHipster 中文版
› http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
› http://www.cocos2d-iphone.org/
CocoaPods
› http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
› http://code.google.com/mobile/analytics/
WWDC
› https://developer.apple.com/wwdc/
Design Guides and Resources
› https://developer.apple.com/design/
Transcripts of WWDC sessions
› http://asciiwwdc.com
Cocoa with Love
› http://cocoawithlove.com/
Cocoa Dev Central
› http://cocoadevcentral.com/
NSHipster
› http://nshipster.com/
Style Guides
› Google Objective-C Style Guide
› NYTimes Objective-C Style Guide
Useful Tools and Services
› Charles Web Debugging Proxy
› Smore
xiaoloudoufu
V2EX  ›  iDev

NetworkExtension 无法使用 native/bsd socket 访问本地局域网

  •  
  •   xiaoloudoufu · Mar 3, 2022 · 9486 views
    This topic created in 1673 days ago, the information mentioned may be changed or developed.

    各位大佬,最近手头 C++项目需要向 ios 移植,碰到一个奇怪的问题

    场景

    • 重新实现 NEPacketTunnelProvider 接口,内部调用 C++静态库暴露的接口
    • C++静态库中使用 asio ,可以说是使用了 native/bsd socket 接口
    • C++静态库中使用 udp 通信

    问题

    • udp socket 可以访问公网 IP ,无法访问局域网 IP
    • 隐私-本地网络 中的设置似乎只能对 app 起作用,对 NetworkExtension 没有什么用

    还望各位彦祖大佬指导

    说句题外话

    ios 端 native 开发似乎比 android 端的 native 开发容易一些,swift 对调用 c/c++库相当友好

    1 replies  •  2022-03-09 18:12:08 +08:00
    shawndev
        1
    shawndev  
       Mar 9, 2022
    var excludeSimpleHostnames: Bool
    var exceptionList: [String]?
    var matchDomains: [String]?

    有没有试过调整这三个属性?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   795 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:52 · PVG 04:52 · LAX 13:52 · JFK 16:52
    ♥ Do have faith in what you're doing.