2 ms·
The benefit is you don't need a separate service for non-web clients. If you have something TCP-based, it's usable only by non-web clients. If you have somethi
by TazeTSchnitzel 12y ago
The benefit is you don't need a separate service for non-web clients.
If you have something TCP-based, it's usable only by non-web clients. If you have something WebSocket-based, it's usable everywhere.
Edit: An additional consideration: WebSocket is a nice, message-based protocol with easy-to-use APIs everywhere, unlike the stream-based TCP whose usual API (Berkeley sockets) is rather more difficult to use.
- hamidpalo 12y agoTCP is usable everywhere. Socket.io builds on top of websockets. Socket.io is useful when you have legacy web browsers that may not do websockets. Beyond that, it does not bring much over regular websockets.
- TazeTSchnitzel 12y ago> TCP is usable everywhere. Not on the web it isn't. I agree that socket.io offers little over WebSocket except for backwards-compatibility, but the OP's question was more about why you'd want to use WebSocket.