Why is NWPathMonitor handler invoked when there is no change in path?

瘦欲@ 提交于 2021-02-10 06:42:07

问题


I am using NWPathMonitor(https://developer.apple.com/documentation/network/nwpathmonitor) to detect any network changes in my background process. I have noticed recently that every time I open an app and close it the handler is invoked. I also notice that there is no change in the path from the previous value that is passed. I am comparing these fields: interfaceType, supportsIpV4, supportsIpV6 and isSatisfied.

I have seen it many times consistently that when I open an app and close it by swiping it away the handler is invoked. I have observed this behaviour with following apps: App Store, Safari, Whatsapp apps.

Does anyone know why this happens? The reason I am concerned is that the time my background process takes to process this handler could be adding to the network delays on the device.

来源:https://stackoverflow.com/questions/64101673/why-is-nwpathmonitor-handler-invoked-when-there-is-no-change-in-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!