websocket-client icon indicating copy to clipboard operation
websocket-client copied to clipboard

Force socket client to only return byte[] (regardless if data looks like a string)

Open csmorley opened this issue 5 years ago • 1 comments

Thanks for writing an awesome library.

A remote server is sending me text, but i would like to keep it as binary (not a string) as I am doing further processing and don't want cycles wasted on intermediate string conversion which is not necessary.

Is there any option to force the socket client to only return byte[] data?

csmorley avatar Apr 25 '20 17:04 csmorley

Hello @csmorley ,

good idea, implemented in https://github.com/Marfusios/websocket-client/commit/7f91313dfd0930acb639e1ef7cdca6d4a7ad16c7

Try it out, set property IsTextMessageConversionEnabled to false.

Marfusios avatar Apr 26 '20 10:04 Marfusios