send non-binary data
Closed this issue ยท 7 comments
Hi, why socket.send() parameter is from List<int>
type? does it get data as binary array? what if someone wants to send data non-binary?
and I have another question; how we can receive response from a req
socket connection?
Hi, why socket.send() parameter is from List type? does it get data as binary array?
Hey @NaarGes the List<int>
is treated as a binary array. I choose it for ease of use for example when using protobuf to serialize/deserialize data, because they use an Uint8List
which just implements a List<int>
.
what if someone wants to send data non-binary?
If you want to send non-binary data you need to use some kind of serialization/deserialization mechanism like protobuf.
how we can receive response from a req socket connection?
Just use the Streams of ZSocket
one of messages
, frames
or payloads
I updated the README and example to show how to receive messages
Actually I implement it bud I couldn't use it for my flutter application, It gets libzmq.so not found error (or sth like that) in runtime. I tried adding libzmq.so
in my project using your hints from [#1 ] but still couldn't fix that error.
So because I have time limits, I switched using jeromq
itself in Kotlin through MethodChannel
and EventChannel
in flutter.
Yeah getting it to work on Android is a little more difficult than on windows. For Android a compiled version of the standard c++ library is needed as well. I will need to add that to the documentation!
It's a very useful and unique package for dart. Keep it on!
good luck
I've updated the README and improved the steps for Android