News for hackers. Stuff that matters.
Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by Alifatisk on Tuesday March 19, 2024 @07:08PM (#39761262)
> SSE connections keep a mobile device’s radio powered up all the time. You should avoid connecting a SSE stream on a device that has a low battery, or possibly avoid using SSE at all unless the device is plugged in.

Damn, that’s a huge downside

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by afavour on Wednesday March 20, 2024 @12:07AM (#39762777)
Same applies to websockets, but yeah.
Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by Nasreddin_Hodja on Wednesday March 20, 2024 @03:21AM (#39763618)
But isn't your device’s radio powered up all the time anyway?
Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by Alifatisk on Wednesday March 20, 2024 @10:57AM (#39767550)
I think it’s on all the time but the phone has different power levels that it gives the radio, all this to optimize the battery usage.

So depending on how much the phone needs to utilizes the radio, the higher the power level is?

That’s just my theory though.

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by Nasreddin_Hodja on Wednesday March 20, 2024 @11:14PM (#39774588)
I don't think keeping sockets open waiting for incoming data have big impact on battery usage because there is no data transmission at that moment so radio shouldn't consume much energy in stand-by mode.

I use K9-Mail app for email working 24h a day, it has multiple accounts on different IMAP4 servers. You know, IMAP requires one keep-alive socket per subscribed folder and I have no problem with battery usage.

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by illiac786 on Thursday March 21, 2024 @02:52AM (#39775524)
I don’t think IMAP is a good example here. Your email client will try both subscribing and classic polling. Subscribing is not a MUST. And from the point of view of end user, the difference when polling in a classical way is simply that the user will be notified later, so it’s hard to tell what the client really did in the background.
Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by Nasreddin_Hodja on Thursday March 21, 2024 @12:06PM (#39780417)
> way is simply that the user will be notified later, so it’s hard to tell what the client really did in the background.

I receive emails instantly. There is polling option in settings, I've disabled it.