[zeromq-dev] I've written a completely new C# API for ZeroMQ

Martin Sustrik sustrik at 250bpm.com
Tue Dec 21 09:35:31 CET 2010


Hi Alex,

> I have quite a few gripes with clrzmq and clrzmq2, and NZMQ is
> incomplete in several areas, so over a few weekends this past month I've
> written a new C# API for ZeroMQ based on the 2.0.10 release of zmq.h.

Great! I would suggest adding a link to your project to www.zeromq.org. 
It's wiki, so you can do so yourself.

You can add the link to existing .NET binding page or create a new page. 
If the page name starts with "binding:" it will be added to the list of 
bindings automatically.

> A few things that make this sample stand out from the other two ZeroMQ
> C# libraries-
>
> * There's no need to manage your ZeroMQ context; it's taken care of on a
> per-AppDomain basis using refcounting.

I am not familiar with CLR. Doesn't the problem the context is solving 
(i.e. zeromq being used from two libraries that are later on linked into 
a single application and step on each other toes) occur with .NET as well?

> * There is no "message" object because it provides no added benefit in
> C#. Messages are simply Byte[]s, with overloads throughout the API that
> accept Strings.

Fair enough. If there's no support for zero-copy, simply using byte 
arrays is the best way to go.

> * First-class support for .NET events programming, implemented using
> zmq_poll() (but that's completely transparent to the user).

Nice.

> I'd love some feedback. I'm just starting to use it in a project I'm
> working on, and so far it all seems to be working smoothly and at high
> throughput, but I'm releasing it as "beta" because I don't feel that it
> has enough real-world experience yet.

A side issue: Wouldn't it make sense for you clrzmq, clrzmq2, NZMQ and 
Interop guys to at least start working on integration of all the 
projects? I mean, writing the code is easy, maintaining it and fixing 
the bugs is hard. If the projects are integrated into a single one you 
could support four time more features, fix four time more bug, make the 
whole binding four times more stable. Aside of that, having a community 
is much more fun than working alone :)

Martin



More information about the zeromq-dev mailing list