[zeromq-dev] curve handcheck recovery behaviour ?

Laurent Alebarde l.alebarde at free.fr
Thu Oct 3 13:10:18 CEST 2013


Hi Pieter,

Thank you for your quick answer.

Concerning *EAGAIN*, it appears in the method :
/int zmq::curve_client|server_t::next_handshake_command (msg_t *msg_)/
when the machine state is in an unexpected state (default to 
switch(state) when it is not /expect_welcome/ nor /expect_ready/). This 
happens for the client when /process_welcome/ or /process_ready/ return 
-1. So an error from the server leads to a client retry and vice versa.

What happens when we have a EAGAIN : nothing special, just a new message 
receive ?

Is there a retry limit ? If yes, what happens when exhausted ? One 
strategy could be to reset the state machine to the state set in the 
ctor, another one could be to delete the curve objects but keep the 
socket active in a good working state. It is not easy to see what 
happens with the debugger. Could you elaborate a little more please ?


Concerning *EPROTO*, it appears in the method :
/int zmq::curve_client|server_t::process_handshake_command (msg_t *msg_)/
when the machine state is in an unexpected state. This happens for the 
client when /produce_hello/ or /produce_initiate/ return -1. So an error 
from the client leads to a client abort (?) and vice versa.

"EPROTO is an actual handshake error, which always leads to the 
connection being broken " : does it lead to a program termination, or 
just a deletion of the curve objects, or a deletion of the socket ?


Laurent


Le 03/10/2013 12:10, Pieter Hintjens a écrit :
> Hi Laurent,
>
> Afaiu, EAGAIN is for internal retrying; EINTR is an interrupted
> process, and EPROTO is an actual handshake error, which always leads
> to the connection being broken. There's no handshake recovery process.
>
> -Pieter
>
> 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
>>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131003/3ab973a0/attachment.htm>


More information about the zeromq-dev mailing list