Commit Graph

464 Commits

Author SHA1 Message Date
Jens Auer
d1c7280d05 Add mutex for monitor socket 2016-10-11 13:28:45 +00:00
Luca Boccassi
53e5a9a6f9 Problem: zmq_connect with IPv6 "source:port;dest:port" format is broken
Solution: allow for '[' character when doing the basic sanity check
on the TCP endpoint.
Also add unit tests for both IPv4 and IPv6 source;dest format.
2016-09-17 20:04:40 +01:00
Constantin Rack
022cf2aeaa Problem: source code contains tabs
Solution: replace tabes with spaces
2016-09-17 08:44:00 +02:00
a4z
a43f6ce0a6 Problem: scoped optional mutex lock caused unit tests to fail
Solution: Add a scope that scopegurad unlocks the mutex
 before the object instance deletes itself and wants to unlock
a locked mutex
2016-09-04 16:18:07 +02:00
a4z
9201009f17 Problem: socket_base uses macros for mutex lock and unlock
Solution: add a lock guard that takes optional a mutex and use it
2016-09-04 10:11:47 +02:00
KIU Shueng Chuan
603cd1db88 change event monitoring functions to use zmq::fd_t 2016-06-20 22:27:52 +08:00
Yann Diorcet
9835e18f64 Fix compilation with mingw64 using autotools 2016-06-01 15:07:16 +02:00
somdoron
bbfed6b8d0 problem: memory issues, access uninitiailized memory and leak 2016-05-16 15:51:08 +03:00
somdoron
c4d0146f2c problem: udp doesn't enforce correct usage of bind/connect
solution: enforce that dish and gram can only bind and radio can only
connect
2016-05-16 13:34:38 +03:00
Bitiquinho
365c8eda72 Add dgram_t class (based on stream socket and udp engine) 2016-05-15 15:35:35 -03:00
evoskuil
2b798e486a Problem: name conflicts from windows.h, draft API declared in pch. 2016-05-13 20:41:26 -07:00
Doron Somech
c41d514b8b Revert "problem:Socket try to access closed mutex" 2016-05-10 16:23:29 +03:00
Doron Somech
77d3d7b4dc problem:Socket try to access closed mutex 2016-05-10 13:49:57 +03:00
Luca Boccassi
17132f0387 Problem: read-after-free when closing socket
Solution: use socket object's mutex before the send_reap() call that
might deallocate it
2016-05-05 17:47:16 +01:00
Doron Somech
a747f72450 problem:closed poller still associated with socket 2016-05-05 13:50:33 +03:00
Doron Somech
4012538ce4 problem: srcfd is broken 2016-05-04 15:33:19 +03:00
Luca Boccassi
95acb29bfb Merge pull request #1934 from somdoron/master
problem: no documentation for Radio-dish and UDP
2016-04-29 10:40:56 +01:00
somdoron
34d5028ea8 allow specify binding address on radio with udp 2016-04-29 12:17:17 +03:00
hitstergtd
7feb1e49fc Problem: Windows IPC check broken (check_protocol)
Solution: Fix the preprocessor check from || to &&
2016-04-22 19:55:08 +01:00
somdoron
e6dae56c6e Scatter-Gather socket types 2016-04-21 14:50:58 +03:00
Luca Boccassi
c8211bf320 Problem: can't unbind with bound addr with IPv6
Solution: try to resolve the TCP endpoint passed by the user in the
zmq_unbind call before giving up, if it doesn't match.
This fixes a breakage in the API, where after a call to
zmq_bind(s, "tcp://127.0.0.1:9999") with IPv6 enabled on s would
result in the call to zmq_unbind(s, "tcp://127.0.0.1:9999") failing.
Add more test cases to increase coverage on all combinations of TCP
endpoints.
2016-04-18 18:43:36 +01:00
hitstergtd
8cb27316fa Problem: check_protocol() logic duplicated twice
Problem:
Conditional logic in check_protocol() that checks if a protocol is supported,
is duplicated twice. Moreover, the first set of checks to ascertain if a
protocol is supported is done regardless of whether the particular protocol
will be built into the library or not.

Solution:
* Simplify/collapse all supported protocol checks into one in check_protocol()
* Enclose pgm/epgm/norm socket+protocol match checks with requisite macros
2016-04-15 15:39:46 +01:00
hitstergtd
362377948e Problem: errno not set if UDP is NOT used with ZMQ_RADIO or ZMQ_DISH
Solution: set errno to ENOCOMPATPROTO in check_protocol()
2016-04-15 01:23:34 +01:00
Luca Boccassi
80e529a16a Problem: all tests fail with assert in in_event
Solution: socket_base_t::in_event cannot do anything useful with
return status of process_commands. Asserting is the wrong solution,
as it is entirely valid to be interrupted or for the context to be
terminated, so discard the value.
2016-02-22 00:05:52 +00:00
Luca Boccassi
ae8efc21e8 Problem: nullptr is a reserved keyword in C++0x
Solution: use NULL instead to avoid build failure with older
compilers.
2016-02-21 23:54:18 +00:00
Luca Boccassi
c21dd8d6a2 Problem: socket_base_t initialization reorder
Solution: initialize class variable in the same order as they are
defined.
2016-02-21 23:41:02 +00:00
Luca Boccassi
d4c0716473 Problem: indentation should be 4 spaces, no tabs
Solution: fix it
2016-02-21 23:16:44 +00:00
Osiris
b3d5fa63a0 Problem: Several problems found by Coverity Static Analyzer
Solution: The Coverity Static Code Analyzer was used on libzmq code and found
many issues with uninitialized member variables, some redefinition of variables
hidding previous instances of same variable name and a couple of functions
where return values were not checked, even though all other occurrences were
checked (e.g. init_size() return).
2016-02-21 15:49:47 -06:00
Osiris
4a5af9d58b Problem: Precompiled headers not being used
Solution: Phase I - make precompiled.hpp be first file included in every source file
2016-02-18 10:56:52 -06:00
somdoron
352ae1468f remove using of dynamic cast 2016-02-17 19:33:17 +02:00
Pieter Hintjens
44c6b0484e Revert "Revert "Problem: deprecated use and reference of zmq_term"" 2016-02-01 23:00:06 +01:00
Pieter Hintjens
1708bfefb7 Revert "Problem: deprecated use and reference of zmq_term" 2016-02-01 22:41:51 +01:00
Constantin Rack
589464ced9 Problem: comments still refer to deprecated zmq_term.
Solution: replace with `zmq_ctx_term`

Also fix whitespace (tabs instead of spaces)
2016-02-01 21:51:54 +01:00
Min RK
cdec4dc9ee allow underscores in domain names
Since they are allowed

(They are not, however, allowed in hostnames)
2016-01-30 21:30:30 +01:00
Jean-Christophe Fillion-Robin
f329252dcb Style: Fix unused parameter compilation warnings
This commit addresses the following warnings reported on gcc 5.2.1. In
the future, this will help reduce the "noise" and help catch warnings
revealing a serious problem.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
/path/to/libzmq/src/options.cpp:1048:36: warning: unused parameter ‘option_’ [-Wunused-parameter]
 bool zmq::options_t::is_valid (int option_) const
                                    ^

/path/to/libzmq/src/plain_client.cpp:146:30: warning: unused parameter ‘cmd_data’ [-Wunused-parameter]
         const unsigned char *cmd_data, size_t data_size)
                              ^

/path/to/libzmq/src/plain_client.cpp:146:30: warning: unused parameter ‘cmd_data’ [-Wunused-parameter]
         const unsigned char *cmd_data, size_t data_size)
                              ^

/path/to/libzmq/src/socket_base.cpp:1445:44: warning: unused parameter ‘group_’ [-Wunused-parameter]
 int zmq::socket_base_t::xjoin (const char *group_)
                                            ^
/path/to/libzmq/src/socket_base.cpp:1451:45: warning: unused parameter ‘group_’ [-Wunused-parameter]
 int zmq::socket_base_t::xleave (const char *group_)
                                             ^

/path/to/libzmq/src/radio.cpp:145:33: warning: unused parameter ‘msg_’ [-Wunused-parameter]
 int zmq::radio_t::xrecv (msg_t *msg_)
                                 ^
/path/to/libzmq/src/dish.cpp:164:32: warning: unused parameter ‘msg_’ [-Wunused-parameter]
 int zmq::dish_t::xsend (msg_t *msg_)
                                ^

/path/to/libzmq/tests/test_msg_ffn.cpp:32:16: warning: unused parameter ‘data’ [-Wunused-parameter]
 void ffn(void *data, void *hint) {
                ^

/path/to/libzmq/tests/test_timers.cpp:50:19: warning: unused parameter ‘timer_id’ [-Wunused-parameter]
 void handler (int timer_id, void* arg)
                   ^
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
2016-01-30 02:56:03 -05:00
somdoron
5ebfd1728f make udp support for radio-dish 2016-01-29 21:17:11 +02:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
somdoron
b8425a25cf radio-dish pattern 2016-01-27 18:22:48 +02:00
Min RK
f0dce000b2 stop previous monitor socket before starting new one
avoids leaking sockets due to multiple monitor calls on one socket

Alternative: raise error (not sure what errno; EADDRINUSE?) if collision detected; force manual stop.
2016-01-21 16:21:07 +01:00
Ilya Kulakov
e7850410f8 Fix trailing spaces. 2016-01-21 13:44:15 +06:00
Ilya Kulakov
e5894d5197 Fix missing headers which makes compilation fail on Android. 2016-01-21 13:44:01 +06:00
Pieter Hintjens
2566c02a9e Problem: CLIENT and SERVER don't check SNDMORE
These sockets don't handle multipart data, so if callers send it,
they drop frames, and things break silently.

Solution: if the caller tries to use ZMQ_SNDMORE, return -1 and
set errno to EINVAL.
2015-12-29 17:00:06 +01:00
Pieter Hintjens
31c35498af Revert "fixes #1565: Allow session to flush commands on an engine error"
This reverts commit 54799c8c6f.

This change broke the tests/test_shutdown_stress testcase.
2015-12-17 16:20:48 +01:00
Sathish Yenna
7cfa93352e Add missing support for IPv6 link local addresses (which include % followed by the interface name) 2015-12-09 16:26:34 -06:00
Luca Boccassi
a556b500da Problem: build failure, vmci include out of IFDEF
Solution: do not include vmci header outside of vmci IFDEF
Fixes issue #1655
2015-12-08 17:53:31 +00:00
Ilya Kulakov
68b13fbddb Add the VMCI transport.
VMCI transport allows fast communication between the Host
and a virtual machine, between virtual machines on the same host,
and within a virtual machine (like IPC).

It requires VMware to be installed on the host and Guest Additions
to be installed on a guest.
2015-12-08 13:16:09 +06:00
Charles Stanley
54799c8c6f fixes #1565: Allow session to flush commands on an engine error 2015-11-30 10:05:47 -05:00
Charles Stanley
516b440e0d fixes #1315 socket monitor hangs if zmq_bind fails 2015-10-09 09:02:09 -04:00
KIU Shueng Chuan
25a50ca0d5 avoid dereferencing uint32_t on unaligned address 2015-09-08 17:26:31 +08:00
Constantin Rack
bd923f0fbb Problem: some comments contain typos 2015-09-06 18:46:32 +02:00
Joe Eli McIlvain
33419425eb Problem: Private/internal macros defined in public header.
Solution: Move the macros to a private header.
2015-08-21 16:12:22 -07:00
Joe Eli McIlvain
61217a2686 Problem: Source files contain mixed tabs and spaces.
Solution: Convert to spaces and remove trailing whitespace in these files.
2015-08-20 07:46:34 -07:00
reza.ebrahimi
1621c25ef0 define a macro for heap object deletion in a unified manner (related to issue #1524) 2015-08-17 00:35:11 +04:30
somdoron
a63818904d add methods to handle poller 2015-08-16 13:57:28 +03:00
somdoron
34968771ca add an option to check if the socket is thread safe 2015-08-16 11:50:50 +03:00
Rik van der Heijden
c68e9a39bf Merge fix for zeromq/zeromq4-1#52, getsockopt ZMQ_RCVMORE now resets all bits 2015-08-11 21:37:50 +02:00
Brian Silverman
773a06fc23 Fix memory leak when creating a socket fails.
Previously, AddressSanitizer flagged leaks when running
tests/test_many_sockets.cpp.
2015-07-22 11:18:48 -07:00
Constantin Rack
15f9ee19cb Solution: allow brackets in tcp ipv6 address 2015-06-23 08:54:49 +02:00
Richard Newton
15eecf4cf4 Update high water marking to allow changing high water mark after connection established. 2015-06-05 17:14:55 +01:00
Richard Newton
9f8b8af926 Fail ZMQ_SNDHWM and ZMQ_RCVHWM setsockopt if already connected. 2015-06-05 10:43:40 +01:00
Pieter Hintjens
a07244cda2 Merge pull request #1414 from hintjens/master
Problem: source file headers are somewhat confusing about LGPLv3
2015-06-02 23:40:52 +02:00
Pieter Hintjens
8620c3e032 Problem: source file headers are somewhat confusing about LGPLv3
Of course people still "can" distributed the sources under the
LGPLv3. However we provide COPYING.LESSER with additional grants.

Solution: specify these grants in the header of each source file.
2015-06-02 22:33:55 +02:00
ALEKSANDR MELNIKOV
1eb8e2a69f HPUX build and gmake check issues solution (#1412) 2015-06-02 20:17:15 +06:00
Constantin Rack
8a3296c1aa Solution: add missing brackets 2015-05-23 23:18:10 +02:00
somdoron
5a897f7509 allocate reaper_signal only when needed 2015-02-12 20:42:31 +02:00
somdoron
6749c9b3eb thread safety 2015-02-12 18:54:22 +02:00
somdoron
862cd41c65 implement client socket type and drop messages when more flag is set on client and server 2015-02-02 11:59:13 +02:00
somdoron
5632b57b4a adds server socket type and routing id to msg 2015-02-02 01:17:37 +02:00
Pieter Hintjens
94d9a4ffdf Problem: copyright statements are out of date
Solution: update for 2015

Fixes #1320
2015-01-22 10:32:37 +01:00
Thomas Rodgers
7c0a644625 Remove of ZMQ_IDENTITY_FD socket option
Revert "linking fd to pipe identity via socket option"

This reverts commit fe3e8c5c70.

Conflicts:
	include/zmq.h
	src/pipe.hpp
	src/session_base.cpp
2015-01-09 17:28:50 -06:00
Martin Hurton
905b1683c7 Fix issue #1257 2014-11-24 15:07:59 +01:00
Pieter Hintjens
b6e61d72b2 Problem: linger values other than -1 or 0 are unsafe
Solution: set defaults back to infinity, and add new context
option, ZMQ_BLOCKY that the user can set to false to get a
less surprising behavior on context termination. Eg.

    zmq_ctx_set (ctx, ZMQ_BLOCKY, false);
2014-11-17 11:56:59 +01:00
lysyloren
09e7416ee9 Unbind socket with real endpoint when binding by wild-card * address 2014-10-27 14:16:36 +01:00
Martin Hurton
a54d8d7b0c Reset metadata for outbound messages 2014-08-13 08:53:54 +02:00
Martin Hurton
816299f11c Code cleanup 2014-07-09 14:07:32 +02:00
Martin Hurton
54e0fde1cc Resolve issue #949 2014-07-09 10:02:53 +02:00
Pieter Hintjens
ce8fbb26cb Problem: zmq_connect doesn't return EINVAL on invalid endpoint
Solution: set errno to EINVAL when tcp:// endpoint is invalid (was just
leaving errno to previous value).
2014-06-25 12:48:26 +02:00
Pieter Hintjens
2524e26893 Code cleanups 2014-06-25 12:47:39 +02:00
Pieter Hintjens
deaad00ad9 Problem: zmq_connect() does not validate TCP addresses
Since https://github.com/zeromq/libzmq/commit/350a1a, TCP addresses
get resolved asynchronously, so zmq_connect no longer returned an
error on incorrect addresses.

This is troublesome since we rely on some error checking to catch
blatant errors.

Solution add some upfront syntax checking that catches at least the
obvious kinds of errors (invalid characters, wrong or missing port
number).
2014-06-24 14:33:38 +02:00
Martin Hurton
dd2be381ad Add const qualifier to register_endpoint param 2014-05-23 12:27:01 +02:00
Martin Hurton
414fc86b22 Code cleanup
- limit visibility of pending_connection_t
- add const qualifiers
2014-05-21 13:08:15 +02:00
Martin Hurton
5f4145e7cb Small code cleanup
- add const modifier to address parameter of event generating functions
2014-05-20 21:48:59 +02:00
Stoian Ivanov
d5991d6728 merge to upstream 2014-05-12 10:24:31 +03:00
Stoian Ivanov
fe3e8c5c70 linking fd to pipe identity via socket option 2014-04-30 16:34:55 +03:00
Pieter Hintjens
9753de8566 Problem: zmq_socket_monitor code is dirty
Specifically:

* zmq_event_t should not be used internally in libzmq, it was
  meant to be an outward facing structure.

* In 4.x, zmq_event_t does not correspond to monitor events, so
  I removed the structure entirely.

* man page for zmq_socket_monitor is incomplete and the example
  code was particularly nasty.

* test_monitor.cpp needed rewriting, it was not clean.
2014-04-28 11:30:49 +02:00
bebopagogo
33f22d0d04 added norm_engine 2014-03-15 10:48:12 -04:00
Mark Barbisan
350a1ac12b Allow TCP addresses to be re-resolved whenever there is a reconnection attempt 2014-03-12 13:28:37 -04:00
Pavel Pimenov
acfbfe53bc Fix build with ZMQ_HAVE_WINDOWS (typedef UINT_PTR fd_t; -> unsigned type)
V547 Expression 'file_desc >= 0' is always true. Unsigned type value is always >= 0. socket_base.cpp 845
  V547 Expression 'file_desc >= 0' is always true. Unsigned type value is always >= 0. socket_base.cpp 863
  V547 Expression 'file_desc >= 0' is always true. Unsigned type value is always >= 0. socket_base.cpp 897
  http://www.viva64.com/en/d/0137/print/
2014-02-21 13:22:53 +04:00
Pieter Hintjens
ab9349d3fe Revert "Fix potential memory leak"
This reverts commit 50d34e5653.
2014-02-11 18:30:08 +01:00
Martin Hurton
a09407829e Fix identity handling for inproc transport
Fixes #872
2014-02-09 21:02:00 +01:00
Alex Pyrgiotis
50d34e5653 Fix potential memory leak
Delete the socket if the initialization part of the socket creation
fails.
2014-02-03 18:03:25 +02:00
Alex Pyrgiotis
e6ef16d005 Fix potential segmentation fault
Call the allocation assertion macro before dereferencing the socket
pointer.
2014-02-03 17:35:53 +02:00
Martin Hurton
e46ec31209 Implement socket_base_t::get_credential member function
The get_credential () member function returns
credential for the last peer we received message for.
The idea is that this function is used to implement user-level API.
2014-01-13 00:40:27 +01:00
Stefan Radomski
3aeaa6fab1 ZMQ_SRCFD docs and tests
Also moved the fd field from message content to message itself
2014-01-07 01:09:51 +01:00
Stefan Radomski
f30fb8501e Expose remote FD via zmq_msg_get(&msg, ZMQ_SRCFD)
This patch allows client applications to retrieve the remote endpoint from a message that originated from a tcp socket
2014-01-06 10:31:42 +01:00
Pieter Hintjens
b3b9e046ee Updated copyright statements for 2014 2014-01-02 12:00:57 +01:00
Trevor Bernard
10a6641ef2 Fix issue #788 - Only allow a single connect per endpoint for SUB, REQ, and DEALER sockets 2013-12-14 23:40:34 -04:00
KIU Shueng Chuan
fd8d6d471f use enum retired_fd instead of -1
using -1 causes a warning on Windows platform because SOCKET is unsigned.
2013-12-05 07:04:21 +08:00
Pieter Hintjens
c573f6b812 Fix for issue 574 2013-11-07 14:59:53 +01:00
Erik Hugne
58ac87def1 zmq: narrow condition to include TIPC in build/test
As TIPC transport for 0MQ will only work on post 3.8
Linux kernels where nonblocking connect was added,
we add AC_RUN test to check for this functionality.
Should the test fail, tipc is excluded from build/test.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
2013-11-01 14:59:31 +01:00
Erik Hugne
632677e805 ricnewton review comment
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
2013-11-01 11:17:10 +01:00
Erik Hugne
eab85b5295 zmq: add support for TIPC transport
A ZeroMQ application can opt for TIPC based sockets
using the TIPC port name format:
zmq_bind(sb, "tipc://{type,lower,upper}");
zmq_connect(sc, "tipc://{type,inst}");

'type' is the service ID, and 'lower/upper' can be
used for service partitioning or basic load
balancing.

ZeroMQ TIPC transport requires a kernel >= 3.8
(nonblocking connect support for TIPC).

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
2013-11-01 10:09:22 +01:00
Richard Newton
b9298823b4 Set hwm on connect socket before bind has happend to just that of connects hwm. 2013-09-15 13:35:44 +01:00
Richard Newton
b9c09064d5 Fix whitespace 2013-09-12 21:22:47 +01:00
Richard Newton
379bcb0881 Send identities when connecting pending sockets. 2013-09-12 21:07:29 +01:00
Richard Newton
7c3496a76a Fix race condition and support multiple socket connects before bind. 2013-09-12 18:09:37 +01:00
Richard Newton
5f20d63665 First attempt at inproc connect before bind 2013-09-12 14:44:44 +01:00
Pieter Hintjens
282765cab4 Merge pull request #628 from ianbarber/master
Remove delay options
2013-09-02 06:04:51 -07:00
Shawn J. Goff
6a18f59532 Change name of icanhasall to subscribe_to_all
icanhasall is cute (for now), but the effect of the variable is clear
only after tracking down its origin reading the commit. This change is
intended to make it easier for people to have some intuition about its
effect from its name.
2013-08-31 10:02:05 -04:00
Ian Barber
a9baa051dd Merge in master changes 2013-08-20 22:48:04 +01:00
Ian Barber
d485404aab Merge pull request #626 from dkrikun/master
Add ZMQ_CONFLATE socket option
2013-08-20 14:37:52 -07:00
Ian Barber
531d3ebc09 Remove delay options
These were exposed to users, but have subsequently been removed as
sockopts. They are currently only being used by ZAP, so I've moved it to
a simpl function call (actually it's only used in one case even in that,
so there may be a further simplification possible there).
2013-08-18 11:16:21 +01:00
Ian Barber
cb35fd7bfe Attempt to fix disconnect not respecting linger
Looks like linger is honoured properly, but shutting down the session
causes the pipe termination to come from that side - because the local
pipe then shuts down right away it seems to trigger a terminated on the
other end instead of waiting. This way we trigger the termination from
the local end and then terminate the session.
2013-08-18 07:50:53 +01:00
danielkr
daa7a8021f Plug in dbuffer to serve the ZMQ_CONFLATE option
ZMQ_CONFLATE option is passed to pipepair() which creates a usual
ypipe_t or ypipe_conflate_t and plugs it into pipe_t under a common
abstract base.
2013-08-17 23:27:25 +03:00
Richard Newton
d4d23caf32 Add new socket monitor event for when socket monitoring is stopped. 2013-07-01 11:00:46 +01:00
Martin Hurton
aef2171e83 Make last_endpoint attribute of socket object 2013-06-29 17:26:13 +02:00
Pieter Hintjens
ad77937956 Added ZMQ_STREAM socket type
- designed for TCP clients and servers
- added HTTP client / server example in tests/test_stream.cpp
- same as ZMQ_ROUTER + ZMQ_ROUTER_RAW + ZMQ_ROUTER_MANDATORY
- includes b893ce set ZMQ_IDENTITY on outgoing connect
- deprecates ZMQ_ROUTER_RAW
2013-06-27 20:53:15 +02:00
Martin Hurton
c3e40736de Rename terminated->pipe_terminated 2013-06-06 13:28:21 +02:00
Pieter Hintjens
8358d4e832 Renamed ZMQ_DELAY_ATTACH_ON_CONNECT_COULD_THIS_BE_ANY_LONGER to ZMQ_IMMEDIATE 2013-03-12 16:11:19 +01:00
Pieter Hintjens
f0f16505e5 Removed corporate advertisements from source file headers
Copyrights had become ads for Sustrik's corporate sponsors, going against the original
agreement to share copyrights with the community (that agreement was: one line stating
iMatix copyright + one reference to AUTHORS file). The proliferation of corporate ads
is also unfair to the many individual authors. I've removed ALL corporate title from
the source files so the copyright statements can now be centralized in AUTHORS and
source files can be properly updated on an annual basis.
2013-03-12 13:24:57 +01:00
Guido Goldstein
b0b8ab27c5 Changed message structure for event notifications. 2013-03-08 13:48:18 +01:00
Guido Goldstein
21eeb03b6c Simplified the zmq_event_t structure for easier access and better usability towards language bindings. 2013-03-08 10:34:25 +01:00
Sébastien Rombauts
41d79bc19e Windows CE support : using standard _WIN32_WCE flag instead of WINCE
- when compiling for Windows CE, a C++ project must define the preprocessor definitions: UNDER_CE=$(CEVersion),_WIN32_WCE=$(CEVersion)
- choosing the "_WIN32_CE" form for uniformization with "_WIN32" and "_WIN32_WINNT" already used in libzmq (boost is using both forms)
- see http://msdn.microsoft.com/en-us/library/ee479161(v=winembedded.60).aspx
2013-02-19 16:49:23 +01:00
Sébastien Rombauts
927000fe2f Fixed 7 MSVC2008 Compiler Warning (level 3) C4800: 'const int' : forcing value to bool 'true' or 'false' (performance warning)
- added explicit test "(xxx != 0)" to get a "bool" value out of the "int" expression
- see the MSDN recommandation http://msdn.microsoft.com/en-us/library/b6801kcy(v=vs.90).aspx
2013-02-19 14:27:14 +01:00
Pieter Hintjens
8ab3c4a1bf Fixed issue #500 2013-01-31 21:52:30 +01:00
Pieter Hintjens
309740e197 Fixed issue #499 2013-01-31 20:47:45 +01:00
Matt Arsenault
6ce464414b Fix typos 2013-01-02 03:24:11 -05:00
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