How To Monitor Network Activity From Within App?

后端 未结 3 429
猫巷女王i
猫巷女王i 2020-12-24 04:06

I\'m trying to monitor network activity on my iPhone from within an app I\'m developing. Does iOS support a netstat-like command or something similar that can tell me what

3条回答
  •  臣服心动
    2020-12-24 04:23

    I can't test this but from what I gather you will have to use sysctl in combination with sysctlnametomib or alternatively sysctlbyname for this:

    sysctlbyname("net.inet.tcp.pcblist", ...)
    

    and/or

    sysctlbyname("net.inet.udp.pcblist", ...)
    

提交回复
热议问题