[zeromq-dev] curve handcheck recovery behaviour ?
Martin Hurton
hurtonm at gmail.com
Fri Oct 4 07:45:24 CEST 2013
Hi Laurent,
curve_server_t implements mechanism interface.
As for handshake, there are two generic functions:
next_handshake_command and process_handshake_command. These functions
are used to generate and process handshake messages and are usually
implemented as state machines.
Those two functions are used by stream engine . Stream engines are
just interface between TCP sockets and 0MQ internals. Stream engine
receives message from network, decodes it and passes it down to
mechanism. Or it gets message from mechanism, encodes it and sends it
out using TCP socket.
next_handshake_command returns -1 and sets errno to EAGAIN when the
curve_server still waits for a handshake message from its peer.
process_handshake_command returns -1 and sets errno to EPROTO when
curve_server gets unexpected, unrecognized or corrupted message. It
sets errno to EACCESS when ZAP rejected the connection. The EAGAIN
returns on line curve_server.cpp:374 looks like bug.
I hope this helps.
- Martin
On Thu, Oct 3, 2013 at 12:03 PM, Laurent Alebarde <l.alebarde at free.fr> wrote:
> Hi Developpers,
>
> Could you please explain me how the curve handcheck behave when a bad packet
> is detected ? There are different types of errors : EPROTO, EINTR, EAGAIN,
> etc.. Some are fatal, others lead to a retry, others possibly to a abandon
> of the connexion.
>
> I understand for example that EAGAIN leads to a retry ? From the very
> beginning of the handcheck after having deleted or free all the objects like
> curve_server_t or mechanism_t ? Or only reset the current state and wait
> again for a valid message ? So isn't it more a WARNING ?
>
> A little description of the philosophy, behaviour and events would be very
> useful to me.
>
> Thanks in advance,
>
>
> Laurent.
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list