[zeromq-dev] conventions in bindings

john skaller skaller at users.sourceforge.net
Wed Feb 1 00:43:51 CET 2012


On 01/02/2012, at 9:17 AM, MinRK wrote:

> 
> In terms of nomenclature, should bindings follow the czmq convention of using Frame to refer to a message part, or Message, following libzmq?

IMHO the terminology here is a bit confusing.  First, "frame" is a bad word to use because that is
a technical term which refers to "on the wire" packaging of data. 

I would use terms like:

MessageContainer: the zmq object
MessageBuffer: the char array which might be used to hold a message
Message: the actual bytes of user data
MessagePart: some of the actual bytes of user data.

In Python you'd never see a MessageBuffer, but you see them in C.

The Felix binding supports zmq_msg_t  but I never use them,
the interface is too low level to bother with unless you're needing ultra-performance.

I use the higher level "send_string" and "recv_string" and for multi-part
messages "send_strings" and "recv_strings".


> 2. SOCKOPT defaults
> 
> Default values vary, and czmq makes some choices that differ from libzmq:
> 
> * SUB sockets default to SUBSCRIBE("") instead of None
> * LINGER is a property of the Context, and sets a default value for its sockets, which is 0 by default, instead of -1
> 
> Should other bindings follow these conventions?

Each binding has to follow conventions suitable to the language.

Felix is a C like language with an ML like type system.
The socket options are supported by proper variant types.

No options of anything have directly accessible integer values,
they're mainly either abstract or variant (union) types.

Other changes: I am tending to standardise times in Felix 
as a float double in seconds (since Epoch). So I use that
instead of whatever ZMQ uses.

> 3. shutdown

And socket closure .. always a PITA in any language.


--
john skaller
skaller at users.sourceforge.net







More information about the zeromq-dev mailing list