socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

Cannot send binary data

Open Seluj78 opened this issue 4 years ago • 4 comments

When we send binary data and the last byte is 10000000 with std::make_shared<std::string>(data, size) we get the following error. Every other data packet seems to work fine until we get to one where the last byte is the one said above.

The error: libc++abi.dylib: terminating with uncaught exception of type std::invalid_argument: stoi: no conversion

Any clue what we might've done wrong ?

cc @tnicolas42 who's working with me

Seluj78 avatar Feb 01 '21 12:02 Seluj78

Hi,

Any progress? I encountered the same problem. It seems that it fails to parse the received binary payload. I opened another issue on https://github.com/socketio/socket.io-client-cpp/issues/299

linsinan1995 avatar Mar 30 '21 19:03 linsinan1995

Sadly, we didn't use it this way. @tnicolas42, how did we end up doing it ?

Seluj78 avatar Mar 30 '21 19:03 Seluj78

Finally, we sent binary data has hex string. So we have to convert all data before send it...

timnicolas avatar Mar 30 '21 21:03 timnicolas

Strange. Sending binary msg works well for me. Thanks for the info!

linsinan1995 avatar Mar 30 '21 22:03 linsinan1995