How To Monitor Network Activity From Within App?

后端 未结 3 430
猫巷女王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条回答
  •  猫巷女王i
    2020-12-24 04:23

    After some searching I found Apple's code used for netstat.

    Everything you need in the void protopr(uint32_t proto, char *name, int af) function.

    I tested on the device and sysctlbyname("net.inet.tcp.pcblist_n",...) works.

    That should be all you need.

提交回复
热议问题