clrzmq
Aims to provide the full functionality of the underlying ZeroMQ API
You can install clrzmq from binaries or source code, the binding currently targets ØMQ v2.1.
Binaries
If you are using .NET on Windows you can install the clrzmq NuGet package (it includes the binaries of the ØMQ and clrzmq libraries).
Source Code
http://github.com/zeromq/clrzmq
Build
Microsoft Visual C# 2010 Express or MonoDevelop 2.2 or later is recommend.
Four build profiles have been included with the aim of provide a cross platform binding.
Binaries will be placed in /bin/debug or /bin/release.
- WIN_DEBUG Target CPU: x86/x64
- WIN_RELEASE Target CPU: x86/x64
- POSIX_DEBUG Target CPU: x86/x64
- POSIX_RELEASE Target CPU: x86/x64
Make sure to select the configuration appropriate for your platform.
N.B. The ZeroMQ library file will need to be made available for the binding to work.
Usage/Examples
The binding is available within the ZMQ namespace.
The guide examples should be used to gain a better understanding of the API.
Bug Reporting
http://github.com/zeromq/clrzmq/issues
Mailing list
gro.qmorez.stsil|ved-qmorez#gro.qmorez.stsil|ved-qmorez
ZeroMQ Interop
There is an MIT-licensed binding available at CodePlex.
Source & Binaries
Current release (May 22nd, 2011)
ZeroMQ Interop v0.8.304.11142 (beta)
Features & Goals
- First-class support for .NET events programming, implemented transparently using zmq_poll()
- Messages are simply Byte[]s, with overloads throughout the API that accept Strings
- Context management is taken care of automatically on a per-AppDomain basis using refcounting
- Compile with any C# 3.5 compiler, run on any ECMA-334 (.NET 2.0) compatible CLI
- Support for both 32 and 64 bit versions of the library on any platform that has an official ZeroMQ port
Example
// Set up a publisher. var publisher = new ZmqPublishSocket { Identity = Guid.NewGuid().ToByteArray(), RecoverySeconds = 10 }; publisher.Connect( address: "tcp://127.0.0.1:9292" ); // Set up a subscriber. var subscriber = new ZmqSubscribeSocket(); subscriber.Bind( address: "tcp://127.0.0.1:9292" ); subscriber.Subscribe( prefix: "" ); // subscribe to all messages // Add a handler to the subscriber's OnReceive event subscriber.OnReceive += () => { String message; subscriber.Receive( out message, nonblocking: true ); Console.WriteLine( message ); }; // Publish a message to all subscribers. publisher.Send( "Hello world!" );
