posted 11 years ago
It really varies on a per implementation basis. Socket.io (the Node.js module for WebSockets) provides both the client and server libraries to make getting an application up and running pretty easy. However, it binds you to certain things like using JSON as your message structure. For certain applications the additional data needed to structure data as JSON can be too expensive. If you were creating a game, which typically involves lots of messages, you would want to send data in as light a wrapper as you can.
There are lots of client side libraries out there as well that will help to make the structuring of messages a bit easier when such a library isn't provided by your backend server.