BitShares Forum

Main => General Discussion => Topic started by: coolspeed on June 19, 2015, 01:42:36 am

Title: Replace websocket with socket.io?
Post by: coolspeed on June 19, 2015, 01:42:36 am
Go to Can I Use, and try to search "websocket":
http://caniuse.com/#search=websocket

What is socket.io?
https://en.wikipedia.org/wiki/Socket.IO
Title: Re: Replace websocket with socket.io?
Post by: xeroc on June 19, 2015, 07:29:42 am
Quote frrom wp:
" Socket.IO primarily uses the WebSocket protocol"
Title: Re: Replace websocket with socket.io?
Post by: xeroc on June 19, 2015, 07:30:18 am
Websocket is the technology and socket.io an implementation AFAIK
Title: Re: Replace websocket with socket.io?
Post by: coolspeed on June 19, 2015, 01:39:25 pm
Websocket is the technology and socket.io an implementation AFAIK

"Socket.IO primarily uses the WebSocket protocol with polling as a fallback option,[2] while providing the same interface. Although it can be used as simply a wrapper for WebSocket, it provides many more features, including broadcasting to multiple sockets, storing data associated with each client, and asynchronous I/O.

Advantages

Socket.IO handles the connection transparently. It will automatically upgrade to WebSocket if possible. This requires the programmer to only have Socket.IO knowledge.

Disadvantages

Socket.IO is not a WebSocket library with fallback options to other realtime protocols. It is a custom realtime transport protocol implementation on top of other realtime protocols. Its protocol negotiation parts cause a client supporting standard WebSocket to not being able to contact a Socket.IO server. And a Socket.IO implementing client cannot talk to a non-Socket.IO based WebSocket or Long Polling Comet server. Therefore Socket.IO requires using the Socket.IO libraries on both client and server side."