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
KIU Shueng Chuan
8c71ac47e8
release critical section on failure to create signaler fdpair
2013-02-15 10:45:43 +08:00
Min(Dongmin Yu)
2c1a3c55f7
LIBZMQ-497 there could be unsent bytes in encoder
...
When we send a large message, the message can be splitted into two chunks.
One is in the encoder buffer and the other is the zero-copy pointer.
The session could get the term before the last chunk is sent.
2013-02-01 17:32:28 +09: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
Pieter Hintjens
18a14aedea
Added ZMQ_IPV6 option, cleaned up setsockopt code, it was nasty
2013-01-30 23:53:09 +01:00
Bjorn Topel
f1e77f2246
Removed heap allocation for in zmq_poll for small item sets
...
Until now, zmq_poll always allocates the poll items on the heap.
Now, small item sets, up to ZMQ_POLLITEMS_DFLT, are stack allocated
and only larger sets are allocated on the heap.
2013-01-30 16:46:45 +01:00
Pieter Hintjens
e8cbfac966
Merge pull request #503 from chazmcgarvey/define-dummy-eproto
...
define a dummy EPROTO for platforms that don't use it
2013-01-23 11:55:48 -08:00
Charles McGarvey
ba3e18f700
define a dummy EPROTO for platforms that don't use it
...
This accomplishes the same thing as 2e2ef7fd in a potentially cleaner way.
2013-01-21 17:14:26 -07:00
Ian Barber
d850272417
Add size check on XSUB message sends
...
Ensures 0 length messages aren't being checked for subscribtion status on whatever data happens to be following the data pointer.
2013-01-21 16:11:27 -08:00
Charles McGarvey
2e2ef7fd33
do not use EPROTO on platforms that do not have it
2013-01-21 15:00:55 -07:00
MinRK
edd43e1ca4
deprecate zmq_ctx_destroy in favor of zmq_ctx_term
...
in order to avoid logical collisions with pre-existing notions of context destruction in bindings (czmq, pyzmq).
2013-01-17 15:48:18 -08:00
Pieter Hintjens
a4bedc5255
Whitespace and comment fixes
2013-01-08 09:16:50 +01:00
Pieter Hintjens
ef186fe15b
Spelling fixes
2013-01-08 09:08:01 +01:00
John Muehlhausen
d32e392278
allow XSUB/XPUB to send/recv messages unrelated to sub/unsub (LIBZMQ-490)
...
zmq::xpub_t::xread_activated() – change to process messages without 0
or 1 prefix, but without affecting subscriptions
zmq::xsub_t::xsend() – change to send rather than discard messages
without 0 or 1 prefix, but without affecting subscriptions
Update documentation
2013-01-07 22:24:24 -06:00
Pieter Hintjens
949d157897
Merge pull request #492 from arsenm/master
...
Make CMake build usable for other systems
2013-01-02 00:32:15 -08:00
Matt Arsenault
6ce464414b
Fix typos
2013-01-02 03:24:11 -05:00
Matt Arsenault
f770954d30
Fix a couple more warnings
2013-01-02 03:24:11 -05:00
Matt Arsenault
6ecb796e77
Fix warnings with MinGW
2013-01-02 03:24:11 -05:00
Matt Arsenault
1ffc5d11dc
Fix some of the -Wshadows
2013-01-02 03:24:11 -05:00
Matt Arsenault
14d3245e02
Fix -Wmismatched-tags
2013-01-02 03:24:11 -05:00
Matt Arsenault
edb5a05add
Fix -Wmissing-field-initializers
2013-01-02 03:24:11 -05:00
Matt Arsenault
3ebab09ce4
Fix unused argument warnings
2013-01-02 03:24:11 -05:00
Matt Arsenault
f3901b35d4
Comments about ICC build failure with 12.x were crazy
...
Fix warnings with ICC.
2013-01-02 03:24:10 -05:00
Matt Arsenault
0362c310a5
First pass at getting cmake build to work with non-Windows systems.
...
Make doc building option dependent on asciidoc being installed
Fix MSVC build requiring cygwin.
Don't use try_run to get the version
2013-01-02 03:24:10 -05:00
Matt Arsenault
73c370dd17
Fix inconsistently using #if or #ifdef instead of #if defined
2013-01-02 03:24:10 -05:00
KIU Shueng Chuan
151a80619b
set SO_LINGER on first signaler socket to close in order to avoid
...
TIME_WAIT state.
2012-12-29 18:05:15 +08:00
KIU Shueng Chuan
322808be9c
eliminate code moved into zmq_utils.cpp
2012-12-29 13:21:50 +08:00
KIU Shueng Chuan
942c654d1c
win32: close zmq-signaler-port-sync event object to avoid handle leak
2012-12-27 21:31:12 +08:00
Min(Dongmin Yu)
a0cecc718d
returns -1 with EAGAIN when mandatory is set and pipe is full
2012-12-11 19:41:36 +09:00
Min(Dongmin Yu)
394d755cf3
return EHOSTUNREACH at full only when mandatory is set
2012-12-09 16:52:45 +09:00
Min(Dongmin Yu)
9382941adc
returns EHOSTUNREACH when a peer is full if ZMQ_ROUTER_MANDATORY is set
2012-12-08 10:20:42 +09: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
Victor Perron
3fc8c7073d
Same fix, in-line style
2012-11-30 22:16:20 +01:00
Victor Perron
33f42efb48
Change NULL to 0 to keep compatibility with some cross-compiling GCC
...
versions
2012-11-30 21:39:22 +01:00
Pieter Hintjens
cae5d3b817
Merge pull request #478 from methodmissing/event-messages-3.2
...
Event message memory corruption fixes
2012-11-22 01:16:55 -08: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
Martin Hurton
a8721c3c04
Check decoder's state function for NULL before calling it
...
Fixes bug reported by Peter Friend
(http://lists.zeromq.org/pipermail/zeromq-dev/2012-November/019425.html )
2012-11-21 22:58:05 +01: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é
ce4d321684
Revert "Merge pull request #473 from methodmissing/fix-engine-endpoint"
...
This reverts commit 1a18c7b0a816e10f8a8a770b2141d47f661f0302, reversing
changes made to bef9a41bdb991b867981317e0e20ee174ecd6fea.
2012-11-17 10:06:09 +00:00
Lourens Naudé
fdf162a117
[LIBZMQ-450] Copy the stream engine endpoint - string reference caused memory corruption
2012-11-16 17:21:07 +00:00
John Muehlhausen
b8d5d3fa69
Issue 468
...
XPUB "verbose" mode excludes unsubscriptions
2012-11-15 15:30:30 -06:00
Lourens Naudé
5205415beb
Fix addresses on triggered events
2012-11-14 09:51:24 +00:00
Martin Hurton
9013ee0d52
Minor code cleanup
2012-11-13 13:06:29 +01:00
Martin Hurton
c543b2ce8c
Resolve LIBZMQ-465
2012-11-13 12:33:30 +01: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
b78800e467
Simplify implementation of DEALER socket
2012-11-09 15:45:25 +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
82999f2d20
Don't forward identities to DEALER sockets
2012-11-09 13:49:38 +01:00
Martin Hurton
c1e960b31d
Never exchange identities for sockets in raw mode
...
Zeromq shall never send/receive socket identifiers for sockets in raw
mode. The existing implementation breaks this requirement after
reconnection.
2012-11-08 19:05:33 +01:00
Martin Hurton
e51a1f04c9
session_base: code cleanup
...
- add unlikely hints
- drop unnecessary assertion
- style fixes
There is no need to require the 'more' flag in the provided message
structure be 0 when pulling message from the session.
2012-11-07 01:07:51 +01:00
Pieter Hintjens
777c38ae32
Renamed raw option to ZMQ_ROUTER_RAW
2012-11-06 13:18:58 +01:00
Martin Hurton
41dc2e6049
Resolve LIBZMQ-459
...
Ref: https://zeromq.jira.com/browse/LIBZMQ-459
2012-11-06 09:35:55 +01:00
Martin Hurton
7c66e8f807
Resolve LIBZMQ-464
2012-11-01 14:37:42 +01:00
Martin Hurton
9d8eb1f9b9
Style fixes
2012-10-30 12:18:30 +01:00
Pieter Hintjens
4bc405a366
Merge pull request #452 from hshardeesi/master
...
New socket option (ZMQ_ROUTER_RAW_SOCK) for ZMQ_ROUTER sockets
2012-10-29 21:00:15 -07:00
Pieter Hintjens
7523b9ed29
Merge pull request #451 from hurtonm/use_correct_types_in_stream_engine
...
Use correct types when returning value in read/write methods
2012-10-29 03:21:33 -07:00
Martin Hurton
3aa30329d1
Use correct types when returning value in read/write methods
2012-10-29 10:46:33 +01:00
Martin Hurton
03deb2c97a
Resolve LIBZMQ-447
2012-10-29 10:15:51 +01:00
Hardeep
83387b4073
Added support for non-zmq tcp client connections to router socket.
...
- Created a new option ZMQ_ROUTER_RAW_SOCK
- Added new raw_encoder and raw_decoder to receive and send messages in raw form to remote client
- Added test case file tests/test_raw_sock.cpp
o To create a raw router sock set the ZMQ_ROUTER_RAW_SOCK option
o ZMQ_MSGMORE flag is ignored for non-id messages
o To terminate a remote connection send id message followed by zero length data message
2012-10-29 00:03:36 -07:00
Pieter Hintjens
0bf8a4d2d2
Code formatting
2012-10-28 07:36:18 +09:00
John Muehlhausen
500f6cffe3
patch for issue 456
...
Do not filter out duplicate subscriptions on the XSUB side of
XSUB/XPUB, so that ZMQ_XPUB_VERBOSE doesn't get blocked by forwarding
devices (as long as the devices all use ZMQ_XPUB_VERBOSE)
2012-10-27 15:51:03 -05:00
Martin Hurton
4824237761
Resolve LIBZMQ-417
...
Ref: https://zeromq.jira.com/browse/LIBZMQ-417
2012-10-25 09:13:09 +02:00
AJ Lewis
422c418a15
Move socket_base.hpp and err.hpp after poll.h include
...
These two headers also include zmq.h somewhere in their dependency
chain, so must be included after poll.h is included for builds to work
on AIX.
2012-10-24 08:37:00 -05:00
Pieter Hintjens
4ba34c9d70
Whitespace and style fixes
2012-10-24 09:18:52 +09:00
Pieter Hintjens
a3889d00c3
Fixed issue #451
2012-10-19 15:09:52 +09:00
Pieter Hintjens
45c063725b
Fixed issue #449
2012-10-18 11:32:13 +09:00
Pieter Hintjens
96811575c3
Fixed issue #448
2012-10-18 11:04:51 +09:00
Pieter Hintjens
3a43bd7354
Several include files were missing
2012-10-16 10:01:26 +09:00
Rohan
93a7a37893
fixed trailing whitespace
2012-10-11 09:32:54 -05:00
Rohan
a438e63498
explicit comments on multicast loopback
2012-10-10 16:22:52 -05:00
rohanbedarkar
11c22912d7
commented out TOS related opt for PGM
2012-10-10 10:08:06 -05:00
Pieter Hintjens
983ee761b1
Renamed ZMQ_ROUTER_BEHAVIOR to ZMQ_ROUTER_MANDATORY for clarity
2012-10-08 16:36:35 +09:00
Pieter Hintjens
f87bf38293
Fixed issue #443
2012-10-08 00:57:43 +09:00
Michel Pelletier
b84d0119b5
Ported from libxs revision 123c0f5387ecef287dd11f4dc790fb76ee1c0f67
...
Handle insufficient resources on accept() decently
If accept() call fails due to insuffient OS resources
the new connection is rejected.
2012-09-30 11:52:43 -07:00
Martin Hurton
82d7238f08
Make socket IO more robust
...
See also https://zeromq.jira.com/browse/LIBZMQ-433
2012-09-29 11:36:52 +02:00
Ivan Pechorin
725f141fd7
Fix LIBZMQ-211: REP socket asserting when getting malformed request
...
REP socket demands at least an empty address stack. The server asserted on (msg_->flags () & msg_t::more) in rep.cpp:75 when receiving a malformed request without empty part.
This patch makes a REP socket to discard and silently ignore such malformed requests.
2012-09-26 16:49:38 +04:00
Ivan Pechorin
9b58372a38
Fix compilation using MSVC 2008: its <algorithm> defines wrong min/max without NOMINMAX
...
Visual Studio 2008 compiler defines min/max as macros in its <algorithm> even if <windows.h> is not included at all. This patch defines NOMINMAX to remove these macros and fix compilation on Visual Studio 2008.
2012-09-26 16:09:55 +04:00
Ivan Pechorin
396b4e3046
Fix compilation using MSVC 2008: stdint.h is not present in this compiler
...
This patch fixes the two headers added recently to include our own "stdint.hpp" instead of system <stdint.h> because the latter is not available in Visual Studio versions prior to 2010.
2012-09-26 16:06:20 +04:00
Ivan Pechorin
9056c13e1e
Use <stdint.h> shipped with Visual Studio 2010 and later
...
Visual Studio didn’t have <stdint.h> until 2010, therefore we had a bunch of typedefs for int8_t, int16_t and the likes in "stdint.hpp". This patch limits these typedefs to Visual Studio versions older than 2010 and uses compiler-shipped <stdint.h> on 2010 and newer.
2012-09-26 15:13:13 +04:00
Ian Barber
afa4933c1e
Init message in drop subscription
...
Fixes reported issue with PGM receiver on 32bit Suse where asserts
were hit due to the msg flags not being zeroed.
2012-09-25 22:58:25 +01: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
Ian Barber
7a40df6d3a
Merge pull request #422 from hintjens/master
...
Replaced device concept with proxy concept
2012-09-07 03:25:31 -07:00
Pieter Hintjens
5db28752f3
Removed 'device' concept and introduced proxies
...
* zmq_device is now a wrapper that calls zmq_proxy
* zmq_proxy adds capture socket
2012-09-07 18:38:50 +09:00
Pieter Hintjens
aaac4b84cb
Code cleanups
2012-09-06 18:20:33 +09:00
Martin Hurton
2a41c8d7b4
Simplify initial handshaking
2012-09-05 20:17:34 +02:00
Martin Hurton
3f6148abdf
Implement new message encoder/decoder
...
This is supposed to become part of the ZMTP/1.1.
The main differences from the ZMTP/1.0 framing protocol are:
- flags field comes first, followed by the length field
- long messages are signaled using a flag rather then 0xff escape
- length field does not include the flags field, 0 is a valid value
2012-09-05 20:17:22 +02:00
Martin Hurton
8672f5829e
Introduce abstract interface for message encoder/decoder
2012-09-05 18:31:27 +02:00
Ian Barber
d7331b7b1f
Fixing PGM issues
...
Hopefully fixed LIBZMQ-427 - there was a slight typo in the init_address
refactor. The encoder refactoring had also broken pgm_sender and
receiver, but just required updating to use the new functions.
2012-09-04 23:24:48 +01:00
Martin Hurton
9d17ead33d
Remove superfluous statement
2012-09-03 19:26:52 +02:00
Martin Hurton
7e6db47e65
Remove unused member variable
2012-09-03 19:07:57 +02:00
Martin Hurton
d9307c9ff0
Make ZMQ interoperate with ZMQ 2.x SUB sockets
...
Since ZMQ 2.x does not support subscription forwarding, it's not
possible to use ZMQ 2.x SUB socket to receive messages from a PUB
socket.
This patch adds some compatibility layer so that ZMQ 2.x SUB socket
receives messages from PUB socket.
2012-09-02 22:46:26 +02:00
Martin Hurton
dfc0222ee6
Decouple encoder_t and decoder_t from session_base_t
...
This patch introduces i_msg_sink and i_msg_source interfaces. This
allows us to make message encoder and decoder more general.
2012-09-02 22:46:26 +02:00