News for hackers. Stuff that matters.
Re:Socket.IO C++ by TazeTSchnitzel on Monday April 13, 2015 @01:21PM (#9368960)
This is trivial to do yourself. JSON.stringify(), JSON.parse(), switch() {}. It's not really some massive benefit of using the library. And this way there's no magic.

Also, magically trying to decode strings if they look like JSON sounds rather scary.

Re:Socket.IO C++ by thedufer on Monday April 13, 2015 @09:44PM (#9371604)
> Also, magically trying to decode strings if they look like JSON sounds rather scary.

That's not what's going on. Each message is tagged with a "type", and one of the tags means "JSON.parse this into an object" while another means "this is just a string".

The rest of the types are for control messages (like ping/pong), I believe.