[nanomsg] flag day for mangos users

  • From: Garrett D'Amore <garrett@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Mon, 9 Mar 2015 05:20:47 -0700

(Ignore this if you don’t use mangos.)

I’ve just fixed #110, which provides for the enforcement of protocol states in 
mangos.  Prior to this change, you could issue a request to either Recv or Send 
and if that didn’t make sense, it would just block ~forever (unless a timeout 
was in place.)

With the fix for #110, for cooked mode (i.e. not raw!) sockets, you will see 
the following new behavior:

* Attempts to receive from Req or Surveyor sockets that have not had a previous 
send done on them fail and return the new error  ErrProtoState.
* Attempts to send to Rep or Respondent sockets that don’t have a corresponding 
request/survey will also fail and return ErrProtoState.
* Attempts to receive from Surveyor sockets that have had their survey time 
expire also return ErrProtoState.  (In the future this could change to a 
timeout error, but its difficult or impossible to distinguish the two cases of 
current outstanding survey, and a survey that has finished.  So there is just 
one return code now.  This used to be ErrRecvTimeout.)
* Attempts to receive on Pub or Push sockets return the new error ErrProtoOp
* Attempts to send on Sub or Pull sockets return the new error ErrProtoOp

Note that these new error codes / enforcements may impact you, and are most 
likely to do so if you use mangos natively, rather than the compat module.  
These new semantics are closer to compatibility with original nanomsg, so 
compat module users are likely to notice only an improvement in fidelity of the 
emulation.

Please let me know if you have any questions or concerns.

        - Garrett


Other related posts:

  • » [nanomsg] flag day for mangos users - Garrett D'Amore