- 04 Jun, 2012 1 commit
-
-
Ian Barber authored
On the advice of Martin Hurton, removed the new command type and just terminated the pipe in a reconnect situation, and notified the socket of the same. This handles the blocking properly, but at the cost of potentially losing in flight messages. However, this is a reasonable trade off given how much simpler it makes the patch.
-
- 03 Jun, 2012 3 commits
-
-
Ian Barber authored
Fix condition so that PGM and EPGM sockets always create pipes immediately, even if delay_attach_on_connect is set. This allows passing through the icanhasall flag, and is realistic given the fact those protocols should be able to connect immediately
-
Ian Barber authored
Fix a number of whitespace issues in various parts of the code, add validation to most calls on the test and take a first stab at implementing the reconnection pipe blocking. It didn't seem straightforward to use any of the existing process calls, so I have added a new command to command_t and friends called detach. This instructs the socket_base to remove the pipe from it's pipe list. The session base stores a copy of the outpipe, and will resend the bind command on reconnection. This should allow balancing again.
-
Ian Barber authored
Remove the extra outpipe handling as the session is quite capable of delaying the creation of the pipe until the connection has happened. Simply don't build the pipe, and let it do that automatically.
-
- 01 Jun, 2012 2 commits
-
-
Douglas Young authored
Fix Win32 build.
-
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.
-
- 31 May, 2012 1 commit
-
-
Steven McCoy authored
Fix Win32 build.
-
- 28 May, 2012 1 commit
-
-
Martin Hurton authored
-
- 21 May, 2012 1 commit
-
-
Lourens Naudé authored
-
- 20 May, 2012 2 commits
-
-
Lourens Naudé authored
Change zmq_monitor_fn type to cast between pointer-to-object and pointer-to-function in a more standards compliant way
-
Ivan Pechorin authored
-
- 04 May, 2012 1 commit
-
-
Lourens Naudé authored
-
- 28 Apr, 2012 1 commit
-
-
Martin Hurton authored
-
- 21 Apr, 2012 3 commits
-
-
Sergey KHripchenko authored
I believe there was a conception that zmq_connect() and zmq_bind() will be called only at the socket creation time and therefore don't need it. Now it is not true anymore.
-
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)
-
Sergey KHripchenko authored
-
- 20 Apr, 2012 1 commit
-
-
Sergey KHripchenko authored
-
- 18 Apr, 2012 1 commit
-
-
Sergey KHripchenko authored
-
- 17 Apr, 2012 1 commit
-
-
Ian Barber authored
socket. Thus, it is shared between subsequent calls to xs_recv (and xs_send). That in turn significantly limits the number of invocations of getimeofday (or similar) when timeouts are used and recv/send is called in a tight loop.
-
- 05 Apr, 2012 1 commit
-
-
Martin Hurton authored
The socket connecting using the inproc transport never received the identity of the remote peer.
-
- 04 Apr, 2012 1 commit
-
-
Martin Hurton authored
The scoket implementation for inproc transfer failed to flush identity message. The result was that the identity message was not delivered until after the user sent the first message. The identity message was never delivered if the user used the socket only to receive messages.
-
- 22 Mar, 2012 2 commits
-
-
Pieter Hintjens authored
Previously, sockets were still "valid" after being closed and only marked as invalid when destroyed. This meant programs could access closed sockets. Now the socket is marked "invalid" when closed.
-
Pieter Hintjens authored
-
- 20 Mar, 2012 1 commit
-
-
Pieter Hintjens authored
* Implemented new ctx API (_new, _destroy, _get, _set) * Removed 'typesafe' macros from zmq.h * Added support for MAX_SOCKETS (was tied into change for #337) * Created new man pages
-
- 19 Mar, 2012 2 commits
-
-
Pieter Hintjens authored
-
Pieter Hintjens authored
-
- 14 Mar, 2012 1 commit
-
-
boris@boressoft.ru authored
* Added two new files: errno.hpp and errno.cpp. They are required to use errno functionality on WM. * zmq.cpp, msg.h: removed inclusion of errno.h because it is included in zmq.h that is also included by .cpp. * windows.hpp: process.h is included only for desktop builds. * thread.cpp: on CE CreateThread is used instead of __beginthreadex * socket_base.cpp, clock.cpp: on CE include cmnintrin.h instead on intrin.h * signaler.cpp: on Windows should use special macro around event name (for unicode builds) * err.hpp: make it include errno.hpp (my file) instead on errno.h when building for CE * err.cpp: use FormatMessage when building for CE (because CE does not have ANSI API functions) * zmq.h: do not include errno.h whe building for CE * libzmq.vcproj: add tro new files
-
- 18 Feb, 2012 1 commit
-
-
Mikko Koppanen authored
-
- 17 Feb, 2012 1 commit
-
-
Mikko Koppanen authored
-
- 16 Feb, 2012 1 commit
-
-
Staffan Gimåker authored
This allows us to actually report an error to the caller on resolve failure, rather than asserting later on in the io thread. Signed-off-by:
Staffan Gimåker <staffan@spotify.com>
-
- 15 Feb, 2012 1 commit
-
-
Pieter Hintjens authored
- anonymous contributor This reverts commit 7b7d4042.
-
- 14 Feb, 2012 1 commit
-
-
Ian Barber authored
-
- 10 Feb, 2012 1 commit
-
-
niXman authored
-
- 08 Feb, 2012 1 commit
-
-
Ian Barber authored
-
- 03 Feb, 2012 2 commits
-
-
skaller authored
We use a distinct context initialisation function to specify all sockets derived therefrom will be thread safe. However the inheritance is done exclusively in the C interface. This is not really correct, but it is chosen to minimise interference with the existing C++ code, including any construct or other calls within the C++ code base. Semantically the C++ code should be unchanged, physically some data structures and extra methods are provided by they're only used from the C binding.
-
skaller authored
1. Reorganise C API socket functions to eliminate bad practice of public functions calling other public functions. This should be done for msg's too but hasn't been in this patch. 2. Reorganise code in C API socket functions so that the socket is cast on one line, the C++ function called on the next with the result retained, then the result is returned. This makes the code much simpler to read and also allows pre- and post- call hooks to be inserted easily. 3. Insert pre- and post- call hooks which set and release a mutex iff the thread_safe flag is on. 4. Add the thread_safe_flag to base_socket_t initialised to false to preserve existing semantics. Add an accessor for the flag, add a mutex, and add lock and unlock functions. Note: as yet no code to actually set the flag.
-
- 02 Feb, 2012 1 commit
-
-
Martin Lucina authored
With the introduction of subscription forwarding, the first message sent on a PUB socket using a unidirectional transport (e.g. PGM) is always lost due to the "subscribe to all" being done asynchronously. This patch fixes the problem and also refactors the code to have a single point where the "subscribe to all" is performed. Signed-off-by:
Martin Lucina <martin@lucina.net>
-
- 16 Dec, 2011 1 commit
-
-
Martin Sustrik authored
Signed-off-by:
Martin Sustrik <sustrik@250bpm.com>
-
- 06 Nov, 2011 1 commit
-
-
Chuck Remes authored
The new function allows to retrieve options (flags) from zmq_msg_t. Signed-off-by:
Chuck Remes <cremes@mac.com> Renamed from zmq_msg_flags to zmq_getmsgopt Signed-off-by:
Martin Sustrik <sustrik@250bpm.com>
-
- 05 Nov, 2011 1 commit
-
-
Martin Sustrik authored
Previous patches have missed the case when the identity should be sent from an inproc endpoint. Fixed. Signed-off-by:
Martin Sustrik <sustrik@250bpm.com>
-