dartzmq 1.0.0-dev.6
dartzmq: ^1.0.0-dev.6 copied to clipboard
A simple dart zeromq implementation/wrapper around the libzmq C++ library
dartzmq #
A simple dart zeromq implementation/wrapper around the libzmq C++ library
Features #
Currently supported:
- Creating sockets (
pair
,pub
,sub
,req
,rep
,dealer
,router
,pull
,push
,xPub
,xSub
,stream
) - Sending messages (of type
List<int>
) - Bind (
bind(String address)
) - Connect (
connect(String address)
) - Curve (
setCurvePublicKey(String key)
,setCurveSecretKey(String key)
andsetCurveServerKey(String key)
) - Socket options (
setOption(int option, String value)
) - Receiving multipart messages (
ZMessage
) - Topic subscription for
sub
sockets (subscribe(String topic)
&unsubscribe(String topic)
)
Getting started #
Currently only windows is officially supported as a platform, but it depends on the used shared library of libzmq
.
I have tested this on windows, which works.
Other platforms have not been tested, but should work.
If you have tested this plugin on another platform and got it to work, please share your findings and create an issue to add it to the list.
Windows #
Place a shared library of libzmq
next to your executable (for example place libzmq-v142-mt-4_3_5.dll
in the folder yourproject/build/windows/runner/Debug/
)
Note that in order for this plugin to work you will need to either get a shared library of
libzmq
or compile it yourself. Especially when using this on windows you need to make sure thatlibzmq
is compiled usingMSVC-2019
if you are usingclang
it will not work (more info)
Android #
Android has not been fully tested, but essentially you can follow these steps, which will get you a libzmq.so
. Which you need to include in your project following these steps
Usage #
Create context
final ZContext context = ZContext();
Create socket
final ZSocket socket = context.createSocket(SocketMode.req);
Connect socket
socket.connect("tcp://localhost:5566");
Send message
socket.send([1, 2, 3, 4, 5]);
Destroy socket
socket.close();
Destroy context
context.stop();
Additional information #
TODO: Tell users more about the package: where to find more information, how to contribute to the package, how to file issues, what response they can expect from the package authors, and more.