1

Socket.io there have been some eternal confusions.

  1. It is supposed to fall back to mechanisms that the browser supports. Does that mean on latest browers it will use websockets over anything else? or does it need to be specifically told to use websockets.

  2. websockets by themselves do they use polling or any other method where other forms of messaging like MQTT excel?

With both these points in mind has anyone taken a note of how socket.io and its working impact the battery life of a device. Considering phongeap/cordova apps having socket.io running inside a embedded browser.

oshomaniac
  • 23
  • 7
  • I would be interested to see some answers on this as well. [This answer](http://stackoverflow.com/a/32791812/931860) to a similar question suggests that pure WebSockets could be very battery efficient. But, Socket.io does a lot more than basic WebSockets. – Dominic P Apr 11 '17 at 21:27
  • I did do some tests. Here is what socket.io did - irrespective of whether it is a modern new browser version or not it did go with polling. then after a while it upgraded the connection to websockets. While the idea is giving support to legacy browsers is good - the operation could have been the other way round - try websocket then fallback to polling. To overcome this i just wrote a tiny browser checker routine to go ahead with sockets the first time around itself. – oshomaniac Apr 13 '17 at 06:22
  • Interesting. Did you try manually specifying the `websocket` transport when you initialized your sockiet.io connection? See [docs here](https://github.com/socketio/engine.io#methods-1). – Dominic P Apr 13 '17 at 19:13
  • Yes i manually specified the websocket transport. – oshomaniac Apr 14 '17 at 17:15

0 Answers0