socket.io-client-swift icon indicating copy to clipboard operation
socket.io-client-swift copied to clipboard

Access voipEnabled property

Open janiduw opened this issue 11 years ago • 5 comments

Thank you for this great library. I'm trying to use socket.io to build a VOIP application and I would require to keep the the socket.io connection alive while in background. I'm aware that iOS provides just a limited amount of time to operate while in background. However I noticed that for VOIP applications this is different as the O/S will not kill any sockets that's created with NSStreamNetworkServiceTypeVoIP.

I've noticed that there is a voipEnabled property inside the WebSocket.swift file but there is no setter for this. When I hardcode this value to true, I'm able to keep the Socket connection when in background.

I would highly appreciate a suggestion or reply to this issue. Thanks

janiduw avatar Oct 22 '15 00:10 janiduw

I guess I can add an option that allows toggling this setting.

nuclearace avatar Oct 22 '15 00:10 nuclearace

That would be helpful. May I know how this property was initially planned to be used ?

janiduw avatar Oct 22 '15 00:10 janiduw

I did not write the WebSocket library, but I assume it's used for the very reason you need it. I just never assumed anyone would be using socket.io to create a VoIP application. Since it seems raw WebSockets or UDP streams would be more efficient

nuclearace avatar Oct 22 '15 00:10 nuclearace

The actual use case is that there is a voip server running on an embedded device. This device does not have any access to the internet. I'm planning to use socket.io on this embedded device to push real time information to the iOS app, things like device temperature etc.

janiduw avatar Oct 22 '15 00:10 janiduw

@janiduw Can you provide how you keep the Socket connection when in background?

ramazanpolat avatar Oct 23 '16 02:10 ramazanpolat