Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acting as VoIP service in background #25

Open
sysdataitalia opened this issue Nov 25, 2014 · 0 comments
Open

Acting as VoIP service in background #25

sysdataitalia opened this issue Nov 25, 2014 · 0 comments

Comments

@sysdataitalia
Copy link

A way to let MQTT work in background can be to set it up as VoIP service with this settings:

  1. Enable the Voice over IP background mode for your app. (Because VoIP apps involve audio content, it is recommended that you also enable the Audio and AirPlay background mode.) You enable background modes in the Capabilities tab of your Xcode project.
  2. Configure one of the app’s sockets for VoIP usage.
  3. Before moving to the background, call the setKeepAliveTimeout:handler: method to install a handler to be executed periodically. Your app can use this handler to maintain its service connection.

But libmosquitto uses socket() from socket.h to create the socket and not one of the following:

Configuring stream interfaces for VoIP usage

  • NSInputStream and NSOutputStream
    For Cocoa streams, use the setProperty:forKey: method to add the NSStreamNetworkServiceType property to the stream. The value of this property should be set to NSStreamNetworkServiceTypeVoIP.
  • NSURLRequest
    When using the URL loading system, use the setNetworkServiceType: method of your NSMutableURLRequest object to set the network service type of the request. The service type should be set to NSURLNetworkServiceTypeVoIP.
  • CFReadStreamRef and CFWriteStreamRef
    For Core Foundation streams, use the CFReadStreamSetProperty or CFWriteStreamSetProperty function to add the kCFStreamNetworkServiceType property to the stream. The value for this property should be set to kCFStreamNetworkServiceTypeVoIP.

Is it possible in any way to set the kCFStreamNetworkServiceTypeVoIP type in socket as for CFReadStreamRef?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant