I’m wondering whether a busy websocket connection uses significantly more battery on iOS than a sparsely utilized one - or if there is a constant overhead simply for maintaining the connection that dominates. This will inform some architectural decisions. Thanks!
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking for assistance in explaining, writing or debugging code are off-topic here. These can be asked on Stack Overflow if they include the desired behavior, a specific problem or error, and the shortest code necessary to reproduce it in the question (see Minimal, Complete, and Verifiable Example)." – amon, gnat, mattnz, Samuel, 8bittree
According to this research paper: HTML5 Connectivity Methods and Mobile Power Consumption, you do consume a significant amount of energy maintaining an inactive websocket, because it is sending frequent messages back and forth to keep the connection alive. Ideally, you would send data at an interval where the websocket could utilize power-saving mechanisms such as "Fast Dormancy" or if the data is sent sporadically, use stateless AJAX requests with a self defined polling frequency.