Matt Arsenault
1ffc5d11dc
Fix some of the -Wshadows
2013-01-02 03:24:11 -05:00
Stefan Radomski
21345ffa50
Break early when pipe to be removed was found
2012-12-04 17:40:43 +01:00
Stefan Radomski
f9770e93ef
Fixed iterator when erasing from inprocs multimap
2012-12-04 17:31:46 +01:00
Stefan Radomski
624dd1e5b5
Removal of terminated pipes from inproc and ignoring peer ends
2012-12-04 17:10:32 +01:00
Stefan Radomski
66c22456b9
Close pipes for inproc sockets on zmq_disconnect
...
- fixes LIBZMQ-476 and LIBZMQ-475
2012-12-04 15:14:21 +01:00
Lourens Naudé
359a505949
Prefer malloc to new for event address allocation as per Martin's recommendation
2012-11-22 00:12:17 +00:00
Lourens Naudé
b1f4850153
Let socket event messages initialize with zmq_msg_init_data and let the framework handle cleanup
2012-11-21 18:27:53 +00:00
Lourens Naudé
6d245eb6bc
Copy monitor specific event endpoints to event messages as the engine etc. can be released at anytime
2012-11-17 11:29:47 +00:00
Lourens Naudé
5205415beb
Fix addresses on triggered events
2012-11-14 09:51:24 +00:00
Martin Hurton
66dc4d8b54
Don't pass flags to xrecv method
2012-11-09 17:18:14 +01:00
Martin Hurton
7865f96e97
Don't pass flags to xsend method
2012-11-09 17:18:10 +01:00
Martin Hurton
ea19b7b658
Small cleanups
2012-11-09 14:12:11 +01:00
Martin Hurton
925a530663
Use const_cast operator to remove const modifier
2012-11-09 14:02:19 +01:00
Martin Hurton
03deb2c97a
Resolve LIBZMQ-447
2012-10-29 10:15:51 +01:00
Pieter Hintjens
4ba34c9d70
Whitespace and style fixes
2012-10-24 09:18:52 +09:00
Pieter Hintjens
96811575c3
Fixed issue #448
2012-10-18 11:04:51 +09:00
Lourens Naudé
759d453368
Significantly reworked the monitoring infrastructure with a more granular per socket API and to play well with monitoring endpoints in application threads
2012-09-21 12:53:31 +01:00
Arthur O'Dwyer
3b984d40e9
Silence all "unused parameter" warnings from Clang.
...
Compiling without warnings is a good goal, because it makes
new warnings (which probably indicate bugs) stand out rather
than getting lost in the spam.
My fixes fall into two categories:
- Adding (void) casts of unused parameters, where their
unusedness seems like a TODO (or in some cases a bug?).
- Removing parameter names altogether, where the function
is clearly a stub that will never use its parameters.
Should be no change in behavior.
2012-08-27 16:05:51 -07:00
Ian Barber
206e5f6f44
Incorrect function name in socket_base
...
VA specific monitor event in socket base was named monitor_event rather
than va_monitor_event
2012-08-26 14:29:09 +01:00
Ian Barber
f028379c1c
Incorrect var name in monitor_event
...
The call to the va version of the function was using 'event' instead of
'event_'
2012-08-26 14:27:12 +01:00
Arthur O'Dwyer
7fadd708a0
Fix monitor_event() to work at all.
...
There are three versions of monitor_event(), all taking
variadic arguments. The original code just has the first one
creating a va_list and passing that va_list variadically to
the second one... which creates a new va_list and passes it
variadically to the third one... and of course everything
blows up when we try to pull a non-va_list argument off the
stack.
The correct approach matches the C standard library's use
of printf/vprintf, scanf/vscanf, and so on. Once you make
a va_list, you must pass it only to functions which expect
a va_list parameter.
2012-08-24 16:42:31 -07:00
Martin Hurton
1ab85f471a
Exchange greeting messages for all socket types
...
Fixes #415 .
2012-08-11 19:04:49 +02:00
Martin Hurton
92827e45ee
Small code cleanup
2012-07-18 01:53:43 +02:00
Martin Hurton
86eaa9c8e7
Rewrite process_command's loop
2012-07-06 12:17:36 +02:00
Ian Barber
e5904e63ce
Allow blocking while connect() is completing
...
This patch, salvaged from a trainwreck accidental merge earlier, adds a
new sockopt, ZMQ_DELAY_ATTACH_ON_CONNECT which prevents a end point
being available to push messages to until it has fully connected, making
connect work more like bind. This also applies to reconnecting sockets,
which may cause message loss of in-queue messages, so it is sensible to
use this in conjunction with a low HWM and potentially an alternative
acknowledgement path.
Notes on most of the individual commits can be found the repository log.
2012-06-12 15:34:48 +01:00
Ian Barber
95cbad3841
Revert "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 reverts commit fe3fb419fe
.
2012-06-12 14:53:57 +01:00
Ian Barber
5b167aa896
Revert "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."
...
This reverts commit 06485d9200
.
2012-06-12 14:52:18 +01:00
Ian Barber
81b8362a59
Revert "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."
...
This reverts commit 6f6466f088
.
2012-06-12 14:51:50 +01:00
Ian Barber
48d3977632
Revert "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"
...
This reverts commit b5ace39e2a
.
2012-06-12 14:51:33 +01:00
Ian Barber
f0920caf02
Revert "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."
...
This reverts commit c13f1d52ff
.
2012-06-12 14:50:50 +01:00
Ian Barber
3ae68d67a4
Revert "Use the hiccup mechanism to notify the socket end of the pair of the change in state, and have it shutdown that end, and shutdown the local end normally. This seems to resolve the shutdown and race condition issues."
...
This reverts commit 67497a2643
.
2012-06-12 14:46:23 +01:00
Ian Barber
f5a072fee1
Revert "Code formatting, and clean up so that xhiccuped is only handled in case the pipe isn't terminating"
...
This reverts commit 5da289cd5b
.
2012-06-12 14:46:01 +01:00
Ian Barber
6eeaf15179
Revert "Remove unnecessary condition in assert"
...
This reverts commit 3053f7e368
.
2012-06-12 14:45:36 +01:00
Ian Barber
eb14890d23
Revert "Revert "Merge branch 'master' of github.com:ianbarber/libzmq""
...
This reverts commit 029d3dfae2
.
2012-06-12 14:43:18 +01:00
Ian Barber
029d3dfae2
Revert "Merge branch 'master' of github.com:ianbarber/libzmq"
...
This reverts commit 3345902979
, reversing
changes made to 889b0e6f29
.
2012-06-12 14:13:17 +01:00
Ian Barber
3053f7e368
Remove unnecessary condition in assert
2012-06-09 00:08:14 +01:00
Ian Barber
5da289cd5b
Code formatting, and clean up so that xhiccuped is only handled in case the pipe isn't terminating
2012-06-09 00:07:30 +01:00
Ian Barber
67497a2643
Use the hiccup mechanism to notify the socket end of the pair of the change in state, and have it shutdown that end, and shutdown the local end normally. This seems to resolve the shutdown and race condition issues.
2012-06-08 23:55:42 +01:00
Ian Barber
c13f1d52ff
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.
2012-06-04 10:27:16 +01:00
Ian Barber
b5ace39e2a
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
2012-06-03 23:01:24 +01:00
Ian Barber
6f6466f088
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.
2012-06-03 22:57:47 +01:00
Ian Barber
06485d9200
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.
2012-06-03 22:05:36 +01:00
Ian Barber
fe3fb419fe
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.
2012-06-01 17:58:19 +01:00
Steven McCoy
13976a3d65
Return error on invalid PGM url instead of raising assertion.
...
Fix Win32 build.
2012-05-30 20:52:19 -04:00
Martin Hurton
24b79c7e0b
Prefer errno_assert/alloc_assert to zmq_assert
2012-05-28 23:17:03 +02:00
Lourens Naudé
adf7a7ade1
Merge branch 'master' into monitor-regressions
2012-05-22 23:35:30 +01:00
Lourens Naudé
4767159f39
Initial stab at a context level monitor callback and registration API
2012-05-21 20:47:11 +01:00
Lourens Naudé
06cce15479
Change zmq_monitor_fn type to cast between pointer-to-object and pointer-to-function in a more standards compliant way
2012-05-20 18:22:13 +01:00
Ivan Pechorin
d25dce9df9
Solaris/SunCC build fix: could not find a match for std::multimap<...>::insert(std::pair<...,...>)
2012-05-20 13:34:08 +02:00
Lourens Naudé
c38aecdc50
Merge branch 'master' into events
2012-05-04 02:35:22 +01:00