enwi/dartzmq

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?

enwi commented

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

enwi commented

I updated the README and example to show how to receive messages

enwi commented

Has this question been resolved for you @NaarGes ?

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.

enwi commented

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

enwi commented

I've updated the README and improved the steps for Android