[zeromq-dev] how to hook ZMTP to prepend outputs and trim inputs ?

Laurent Alebarde l.alebarde at free.fr
Fri Jan 17 11:40:13 CET 2014


Hi Devs,

I am doing some experiments (cf at the end for the goal) and wonder 
where I could hook the beginning of a message both reading and writing.

What I want to do is prepend an outgoing message and trim an incoming 
message (for any mechanism looks simpler) when some option is set.

Typically, when the option is set, when a new message is received, I 
want to be able to store a certain amount of the first bytes in a new 
mechanism buffer, and skip them. These bytes are experimental and not 
ZMTP, so I have to skip or trim them to not hurt ZMTP. When a message is 
sent, I want to initialise the buffer with a copy of what I previously 
stored before ZMTP write the buffer. If it is outpos, I will do outpos 
+= store_size;

So, the question is where & when I should do that to not hurt ZMTP.

FYI, The aim of this experiment is to manage to achieve CURVE proxying. 
My investigations and tests so far lead me to prepend the client ID in 
every message sent to the CURVE worker, and that the worker send back 
this information.

Cheers,


Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140117/d6c4cd01/attachment.htm>


More information about the zeromq-dev mailing list