1. 27 May, 2012 1 commit
  2. 07 May, 2012 1 commit
  3. 04 May, 2012 1 commit
  4. 21 Apr, 2012 1 commit
    • Sergey KHripchenko's avatar
      fixes for zmq_unbind() / zmq_disconnect() usage corner cases · 057fab09
      Sergey KHripchenko authored
      1. when we call zmq_bind()/zmq_connect() to create endpoint
      we send ourselfs(through launch_child()) command to process_own(endpoint)
      (and add it to own_t::owned)
      in the application thread we could call zmq_unbind() / zmq_disconnect() _BEFORE_
      we run process_own() in ZMQ thread and in this situation we will be unable to find it in
      own_t::owned. in other words own_t::owned.find(endpoint) will not be deleted but it will be deleted from
      socket_base_t::endpoints.
      
      2. when you zmq_unbind() the lisnening TCP/IPC socket was terminated only in destructor...
      so the whole ZMQ_LINGER time listening TCP/IPC socket was able to accept() new connections
      but unable to handle them.
      
      this all geting even worse since unfortunately zmq has a bug and '*_listener_t' object not terminated
      untill the socket's zmq_close().
      AT LEAST FOR PUSH SOCKETS.
      Everything is ok for SUB sockets.
      
      Easy to reproduce without my fix:
      
      zmq_socket(PUSH)
      zmq_bind(tcp);
      // connect to  it from PULL socket
      zmq_unbind(tcp);
      
      sleep(forever)
      
      // netstat -anp | grep 'tcp listening socket'
      
      With my fix you could see that after zmq_unbind(tcp) all previously connected tcp sessions
      will not be finished untill the zmq_close(socket) regardless of ZMQ_LINGER value.
      
      (*_listener_t terminates all owned session_base_t(connect=false) and they call pipe_t::terminate()
      which in turn should call session_base_t::terminated() but this never happens)
      057fab09
  5. 18 Apr, 2012 1 commit
  6. 13 Apr, 2012 1 commit
  7. 12 Apr, 2012 1 commit
    • Sergey KHripchenko's avatar
      Implement ZMQ_TCP_ACCEPT_FILTER setsockopt() for listening TCP sockets. · acba6bdd
      Sergey KHripchenko authored
      Assign arbitrary number of filters that will be applied for each new TCP transport
      connection on a listening socket.
      If no filters applied, then TCP transport allows connections from any ip.
      If at least one filter is applied then new connection source ip should be matched.
      To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
      Filter is a null-terminated string with ipv6 or ipv4 CIDR.
      
      For example:
      localhost
      127.0.0.1
      mail.ru/24
      ::1
      ::1/128
      3ffe:1::
      3ffe:1::/56
      
      Returns -1 if the filter couldn't be assigned(format error or ipv6 filter with ZMQ_IPV4ONLY set)
      
      P.S.
      The only thing that worries me is that I had to re-enable 'default assign by reference constructor/operator'
      for 'tcp_address_t' (and for my inherited class tcp_address_mask_t) to store it in std::vector in 'options_t'...
      acba6bdd
  8. 05 Apr, 2012 1 commit
  9. 20 Mar, 2012 1 commit
  10. 20 Feb, 2012 1 commit
  11. 18 Feb, 2012 3 commits
  12. 16 Feb, 2012 2 commits
  13. 14 Feb, 2012 1 commit
  14. 11 Feb, 2012 1 commit
  15. 08 Feb, 2012 1 commit
  16. 01 Nov, 2011 1 commit
  17. 31 Oct, 2011 1 commit
  18. 15 Sep, 2011 1 commit
  19. 02 Sep, 2011 1 commit
  20. 18 Aug, 2011 1 commit
  21. 16 Aug, 2011 1 commit
  22. 15 Aug, 2011 2 commits
  23. 08 Aug, 2011 1 commit
  24. 04 Aug, 2011 1 commit
  25. 28 Jul, 2011 5 commits
  26. 26 Jul, 2011 1 commit
  27. 25 Jul, 2011 1 commit
  28. 21 Apr, 2011 1 commit
  29. 15 Apr, 2011 1 commit
  30. 16 Mar, 2011 1 commit
  31. 02 Mar, 2011 1 commit
  32. 13 Dec, 2010 1 commit