1. 03 Jun, 2012 2 commits
  2. 01 Jun, 2012 2 commits
    • Douglas Young's avatar
      320684ef
    • Ian Barber's avatar
      After speaking with Ben Gray and the discussion on the mailing list, this is an… · fe3fb419
      Ian Barber authored
      After speaking with Ben Gray and the discussion on the mailing list, this is an attempt to create a sockopt to allow connecting pipes to not immediately be available for traffic. The problem is in a PUSH to many PULL situation, where there is a connect to a PULL which is not there. This connect will immediately create a pipe (unlike bind), and traffic will be load balanced to that pipe. This means if there is a persistently unavailable end point then the traffic will queue until HWM is hit, and older messages will be lost.
      
      This patch adds a sockopt ZMQ_DELAY_ATTACH_ON_CONNECT, which if set to 1 will attempt to preempt this behavior. It does this by extending the use of the session_base to include in the outbound as well as the inbound pipe, and only associates the pipe with the socket once it receives the connected callback via a process_attach message. This works, and a test has been added to show so, but may introduce unexpected complications. The shutdown logic in this class has become marginally more awkward because of this, requiring the session to serve as the sink for both pipes if shutdown occurs with a still-connecting pipe in place. It is also possible there could be issues around flushing the messages, but as I could not directly think how to create such an issue I have not written any code with regards to that.
      
      The documentation has been updated to reflect the change, but please do check over the code and test and review.
      fe3fb419
  3. 31 May, 2012 3 commits
  4. 29 May, 2012 1 commit
    • Martin Hurton's avatar
      Fix issue #370 · 7fe45af3
      Martin Hurton authored
      The patch extends the internal session's API with the reset method.
      This method is used to reset a session's state so that it can
      handle a new connection.
      7fe45af3
  5. 28 May, 2012 3 commits
  6. 27 May, 2012 7 commits
  7. 22 May, 2012 1 commit
  8. 21 May, 2012 2 commits
  9. 20 May, 2012 3 commits
  10. 13 May, 2012 1 commit
    • KennyTM~'s avatar
      Allow the ZMQ_MONITOR code compilable on gcc 4.7 on Linux. · c995de65
      KennyTM~ authored
      The current ZMQ_MONITOR code does not compile in gcc 4.7, as -pedantic
      and -Werror are enabled, and ISO C++ doesn't allow casting between
      normal pointers (void*) and function pointers, as pedantically their
      size could be different. This caused the library not compilable. This
      commit workaround the problem by introducing one more indirection, i.e.
      instead of calling
      
          (void *)listener
      
      which is an error, we have to use
      
          *(void **)&listener
      
      which is an undefined behavior :) but works on most platforms
      
      Also, `optval_ = monitor` will not set the parameter in getsockopt(),
      and the extra casting caused the LHS to be an rvalue which again makes
      the code not compilable. The proper way is to pass a pointer of function
      pointer and assign with indirection, i.e. `*optval_ = monitor`.
      
      Also, fixed an asciidoc error in zmq_getsockopt.txt because the `~~~~`
      is too long.
      c995de65
  11. 08 May, 2012 2 commits
    • Martin Hurton's avatar
      Simplify encoder's loop · 64194394
      Martin Hurton authored
      64194394
    • Martin Hurton's avatar
      Fix issue #268 · 3d93c1af
      Martin Hurton authored
      This patch fixes a bug in the message encoder which was
      responsible for computing incorrect message offset.
      The bug affected PGM receiver making it unable to
      decode inital messages.
      3d93c1af
  12. 07 May, 2012 1 commit
  13. 04 May, 2012 1 commit
  14. 03 May, 2012 1 commit
    • Ian Barber's avatar
      Patch from Mato that fixes a subtle connect bug: EAGAIN was being used as a… · 1075005b
      Ian Barber authored
      Patch from Mato that fixes a subtle connect bug: EAGAIN was being used as a translation value for EINPROGRESS, thus
      shadowing a real EAGAIN return value from the OS.  This caused later
      assertions of "Invalid argument" in stream_engine.cpp when it attempted to
      use a socket which was not connected.
      
      I also add EINTR to mean EINPROGRESS, as per the POSIX and FreeBSD
      documentation which specifies that a connect() call interrupted due to a
      signal will complete asynchronously.
      Signed-off-by: 's avatarMartin Lucina <martin@lucina.net>
      1075005b
  15. 29 Apr, 2012 3 commits
    • Martin Hurton's avatar
      Do not crash when multiple peers connect to PAIR socket · d8470949
      Martin Hurton authored
      When more then one peer connected to a ZMQ_PAIR socket,
      an application aborted due to assertion failure.
      This patch changes the ZMQ_PAIR socket behaviour so that
      it rejects any further connection requests.
      d8470949
    • Martin Hurton's avatar
      Fix decoder to properly handle large messages · 5227f676
      Martin Hurton authored
      The decoder did not properly decode large messages
      on systems where sizeof (size_t) < sizeof (uint64_t).
      5227f676
    • Martin Hurton's avatar
      Fix issue #264 · 776563fc
      Martin Hurton authored
      Before this patch, the stream engine terminated itself
      whenever it had detected an IO error. If this happened
      when sending a message, the engine lost all
      in-flight messages, messages waiting to be decoded,
      and the last decoded message that had not been accepted,
      if there was one.
      
      The new behaviour is to terminate the engine only after
      the input error has been detected and the last decoded
      776563fc
  16. 28 Apr, 2012 1 commit
  17. 26 Apr, 2012 2 commits
  18. 25 Apr, 2012 1 commit
  19. 24 Apr, 2012 2 commits
    • Martin Hurton's avatar
      xsub: fix memory leak · df5344bb
      Martin Hurton authored
      The implementation of the send call for XSUB socket failed
      to release and initialise empty message when duplicate
      subscription was detected.
      df5344bb
    • Patrick Trantham's avatar
      Implement atomic operations for armv7a · 135fdab0
      Patrick Trantham authored
      This commit implements atomic operations for the armv7a architecture
      using gcc inline assembly.  This offers higher performance compared to
      pthread mutexes.
      
      Tested on an am3517 evm, clocked at 600MHz:
      
      ./inproc_thr 200 1000000
      ------------------------
      53-60K messages / sec, pthread mutexes
      73-90K messages / sec, assembly atomic ops
      
      ./inproc_lat 200 1000000
      ------------------------
      average latency: 42.234 [us], pthread mutexes
      average latency: 35.496 [us], assembly atomic ops
      135fdab0
  20. 21 Apr, 2012 1 commit