You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is with the socket layer specifically. The background is the single biggest battery hog on a mobile device is the cellular radio. The OS is incentivized to keep these radios off and minimize their usage. This implies a need for communication between the OS and the radio. Should we turn a radio.on for this or would the user be willing to wait? This is complicated even further by the fact that iOS is attempting to manage your battery by backgrounding apps. The ultimate problem becomes the socket bindings are not equipped for this kind of problem, they don't give enough abstractions to user space developers to communicate this info and have this back and forth awareness with the OS. It's worse with multipath for TCP. It's hard to express preferences in a useful way. you can have what looks like a working socket but the OS doesn't know you are trying to use or doesn't know you would rather wake up a radio to use it. This is more common when you background an app. You are not able to ensure that the cellular radio is gonna wake up and do the things you need them to do. To this end Apple shipped a higher level networking framework. It provides quite a few diff things but much of what it provides is how do we provide this extra semantic information to the dev and the phone. This allows connection attempts to be delayed until an appropriate networking channel comes up. Other things it can do is deal with the question of what kind of interface you want. That framework is the supported first party way to do networking on iOS. The socket layer is sort of deprecated on iOS but its not the right way to do things from a swift nio perspective we have a version of swift nio that uses networking instead.
Tools to test: the network link conditioner is an additional tool for xcode and lets you fake out a bunch of diff network environments. There is no file descriptor on iOS.
There is really good network and dispatch queue documentation in the header files of the Network Framework
The text was updated successfully, but these errors were encountered:
The problem is with the socket layer specifically. The background is the single biggest battery hog on a mobile device is the cellular radio. The OS is incentivized to keep these radios off and minimize their usage. This implies a need for communication between the OS and the radio. Should we turn a radio.on for this or would the user be willing to wait? This is complicated even further by the fact that iOS is attempting to manage your battery by backgrounding apps. The ultimate problem becomes the socket bindings are not equipped for this kind of problem, they don't give enough abstractions to user space developers to communicate this info and have this back and forth awareness with the OS. It's worse with multipath for TCP. It's hard to express preferences in a useful way. you can have what looks like a working socket but the OS doesn't know you are trying to use or doesn't know you would rather wake up a radio to use it. This is more common when you background an app. You are not able to ensure that the cellular radio is gonna wake up and do the things you need them to do. To this end Apple shipped a higher level networking framework. It provides quite a few diff things but much of what it provides is how do we provide this extra semantic information to the dev and the phone. This allows connection attempts to be delayed until an appropriate networking channel comes up. Other things it can do is deal with the question of what kind of interface you want. That framework is the supported first party way to do networking on iOS. The socket layer is sort of deprecated on iOS but its not the right way to do things from a swift nio perspective we have a version of swift nio that uses networking instead.
Transport package below that do the swift nio things using Network Framework. https://github.com/apple/swift-nio-transport-services/tree/main/Sources
Tools to test: the network link conditioner is an additional tool for xcode and lets you fake out a bunch of diff network environments. There is no file descriptor on iOS.
There is really good network and dispatch queue documentation in the header files of the Network Framework
The text was updated successfully, but these errors were encountered: