[zeromq-dev] libzmq utility functions

Peter Kleiweg pkleiweg at xs4all.nl
Tue Oct 29 11:04:16 CET 2013

Pieter Hintjens schreef op de 29e dag van de wijnmaand van het jaar 2013:

> I think it's a great idea and was playing with it also. It should go
> into the low level API IMO so it's available to all languages.
> You could make a single API call, zmq_new_endpoint () which has
> different syntax for the endpoint depending on direction. E.g. by
> default, it's a bind but if you prefix with ">" it's a connect.
> It could also be nice to consider endpoint resolution in libzmq using
> an internal protocol as we do for authentication. I.e. bind/connect to
> "$myname" which gets resolved by a plugin into "tcp://hostname:port".

I think these kind of things are more for applications. There, 
you determine what the regular patterns are, and you write 
tiny utility functions that wrap these in a single call.

But what those typical patterns are depends on the application, 
so I don't think this belongs in the library. At least not in 
the C library.

Language bindings for languages that work usually on a more 
abstract level could provide higher level functionality. For 
instance, for my Go binding, there is no setsockoption or 
getsockoption. There's a separate function for each option 
(which also works well with the godoc system), and there are 
even some more higher level functions.

But what type of higher level functionality is required also 
depends on the language. Czmq has things that make no sense in a 
Go binding, because Go does things in a different way.

Peter Kleiweg

More information about the zeromq-dev mailing list