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