iOS 10 and kCFStreamNetworkServiceTypeCallSignaling

Hello,


Our used case is we provide Video SDKs to developers. The video SDK uses uses SIP (rfc3661) for signaling. At present, we use BSD sockets for SIP signaling and, we do not pair sockets with any `CFReadStreamRef` nor we set any property. In iOS 10, we noticed, Apple has introduced new stream type `kCFStreamNetworkServiceTypeCallSignaling`.


My question is, should we pair our SIP signaling sockets with a CFReadStreamRef and set kCFStreamNetworkServiceTypeCallSignaling property on it ? If Yes, what benefits will it give? Please let us know your recommendtations.



Thank you,


Piyush Tank

Replies

For a while now we’ve had a CFSocketStream API (

kCFStreamNetworkServiceType
) for setting network quality of service (QoS). In iOS 10 we finally added a BSD Sockets-level equivalent. Check out the
SO_NET_SERVICE_TYPE
socket option and its related values in
<sys/socket.h>
. You can also find more info on this in WWDC 2016 Session 714 Networking for the Modern Internet.

There’s an obvious mapping from the former to the latter. In the case of

kCFStreamNetworkServiceTypeCallSignaling
, that’s mapped to
NET_SERVICE_TYPE_SIG
. And the header comments for
NET_SERVICE_TYPE_SIG
explain its expected QoS parameters.

… should we pair our SIP signaling sockets with a

CFReadStreamRef
and set
kCFStreamNetworkServiceTypeCallSignaling
property on it ?

You definitely should not do that (in fact, you should never do that!). If you’re working at the BSD Sockets level, use

SO_NET_SERVICE_TYPE
.

If Yes, what benefits will it give?

See the header comments that I referenced above.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"