Commit Graph

478 Commits

Author SHA1 Message Date
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
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
777c38ae32 Renamed raw option to ZMQ_ROUTER_RAW 2012-11-06 13:18:58 +01:00
Martin Hurton
1348924251 Merge pull request #458 from vortechs2000/remove_cpp_comments_from_zmq_h
Older versions of C compilers don't like C++ comments
2012-11-05 09:41:56 -08:00
AJ Lewis
f67a199332 Older versions of C compilers don't like C++ comments
There's no need to exclude older compilers by putting C++ style
comments in the C API header.
2012-11-05 11:27:13 -06: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
ee21fac8b8 Added ZMQ_FAIL_UNROUTABLE alias back as deprecated 2012-10-19 15:16:36 +09:00
Pieter Hintjens
351eff5448 Bumped version to 3.3.0 2012-10-15 13:23:00 +09:00
Pieter Hintjens
8e7892b72f Upated version for next release 2012-10-15 13:06:19 +09: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
Pieter Hintjens
d6e0ae24f3 Prepared for release 3.2.1 2012-10-01 22:52:24 +02:00
Lourens Naudé
b1776e234b Merge branch 'master' into fix-monitor 2012-09-25 01:26:32 +01:00
Astellar
7bf516ded7 zmq_msg_t will now typedef a named struct.
This change allows forward declaration of struct zmq_msg_t.
2012-09-21 19:57:50 +04: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
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
MinRK
a178817141 forward-declare struct iovec
avoids warnings of the form:

warning: 'struct iovec' declared inside parameter list
warning: its scope is only this definition or declaration, which is probably not what you want

when building downstream projects
2012-06-23 12:51:38 -07:00
Pieter Hintjens
b57b7debaa Merge pull request #386 from steve-o/err-handler
Fix missing ENETRESET for Jira #LIBZMQ-329.
2012-06-20 02:34:40 -07:00
Steven McCoy
fc335c59ea Fix missing ENETRESET for Jira #LIBZMQ-329. 2012-06-19 14:15:48 -04:00
Pieter Hintjens
eb16f6b88e Merge pull request #384 from steve-o/err-handler
Add errno fallback values for MSVC2008.
2012-06-18 22:34:40 -07:00
Steven McCoy
5b3d0c633d Add errno fallback values for MSVC2008. 2012-06-18 17:13:17 -04:00
Kobolog
829d0003be Verbose ROUTER socket behavior patch 2012-06-17 02:33:43 +04: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
8643d71ee8 Merge branch 'master' of github.com:zeromq/libzmq 2012-06-06 15:04:56 +01:00
Pieter Hintjens
e5bb5a60f4 Bumped version to 3.3.0 2012-06-06 06:57:43 +02: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
Lourens Naudé
991b7fcc04 Rename zmq_monitor to zmq_ctx_set_monitor for compat with existing context specific APIs 2012-05-22 20:15:18 +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é
e13b3723b8 Rename type zmq_monitor_fn -> zmq_monitor for a more natural callback definition API (zmq_monitor type, monitor.function callback) 2012-05-20 18:27:59 +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
Lourens Naudé
5c6f72c17c ZMQ_MONITOR socket option registers a callback / event sink for changes in socket state 2012-05-04 02:32:46 +01:00
Sergey KHripchenko
489481857a 2nd try wuth sock->unbind() and sock->disconnect(). now with blackjack and const char*'s 2012-04-20 18:59:08 +04:00
Sergey KHripchenko
7b8e728e43 implement zmq_unbind(),zmq_disconnect(), zmq->sock->getsockopt(ZMQ_LAST_ENDPOINT_ID) 2012-04-18 23:42:11 +04:00
Sergey KHripchenko
acba6bdd6c Implement ZMQ_TCP_ACCEPT_FILTER setsockopt() for listening TCP sockets.
Assign arbitrary number of filters that will be applied for each new TCP transport
connection on a listening socket.
If no filters applied, then TCP transport allows connections from any ip.
If at least one filter is applied then new connection source ip should be matched.
To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0).
Filter is a null-terminated string with ipv6 or ipv4 CIDR.

For example:
localhost
127.0.0.1
mail.ru/24
::1
::1/128
3ffe:1::
3ffe:1::/56

Returns -1 if the filter couldn't be assigned(format error or ipv6 filter with ZMQ_IPV4ONLY set)

P.S.
The only thing that worries me is that I had to re-enable 'default assign by reference constructor/operator'
for 'tcp_address_t' (and for my inherited class tcp_address_mask_t) to store it in std::vector in 'options_t'...
2012-04-12 18:37:14 +04:00
jdc8
177264d941 c++ style comments result in compile errors with non-c99 C compiler 2012-04-10 06:33:15 -04:00
Sergey KHripchenko
0c3d917926 initial implementation of tuning TCP keep-alives for TCP socket
currently not fully cross-platform
work on linux
possibly work in *bsd
and could be enhanced to work on windows
2012-04-05 19:39:53 +04:00
Pieter Hintjens
d8c58080a7 Fixed issue #351 2012-04-04 14:39:19 +01:00
Pieter Hintjens
f26e4ab784 Simplified zmq_msg_get/set functions
* Return integer property
* Fixed up man pages, which were inaccurate
* Fixed test case
2012-03-21 14:19:40 -05:00
Pieter Hintjens
6e71a54b1e Fixed issues #337, #341, and #340
* 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
2012-03-19 19:41:20 -05:00
Pieter Hintjens
9ccfbf8d30 Removed zmq.hpp, may add this back in separate commit 2012-03-17 11:12:11 -05:00
Pieter Hintjens
9ac40c47d7 Fixed issue LIBZMQ-333
- reverted commit 941be8d217.
 - fixed zmq_device implementation for latest socket_base class
 - added back zmq_device.3 man page
2012-03-16 16:39:11 -05:00
Kobolog
cb70c5e75d fixed some typos 2012-03-15 15:15:44 +03:00
Kobolog
df584a3be0 an option to fail on unroutable messages in ROUTER sockets 2012-03-15 14:57:38 +03:00
boris@boressoft.ru
318ba8836f Add WinCE support.
* 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
2012-03-14 19:12:28 +04:00
skaller
0fa6b8e793 Remove thread safe context init. 2012-02-18 02:32:15 +11:00
Mikko Koppanen
da1920d944 Revert NULL checks in the API 2012-02-17 09:48:04 +00:00
Chuck Remes
a457be315b Merge pull request #246 from pieterh/arguments
Return EFAULT if required arguments are null
2012-02-16 13:20:33 -08:00
Pieter Hintjens
3ee99ae81f Renamed scatter/gather methods, cleaned up source 2012-02-16 12:30:37 -06:00
Pieter Hintjens
8a497e2ffc Resolved conflicts after merge 2012-02-16 12:27:39 -06:00
Pieter Hintjens
0efb49f12f Fixed up all references to zmq_msg_size 2012-02-16 12:26:00 -06:00
Pieter Hintjens
02b81d42ce Changed return type of zmq_msg_size to ssize_t to allow error return 2012-02-16 12:25:58 -06:00
Pieter Hintjens
07b49ffb9c Fixed up all references to zmq_msg_size 2012-02-16 12:04:25 -06:00
Mikko Koppanen
2f44faa7ce Merge pull request #247 from pieterh/sendrecv
Added zmq_msg_send/recv functions
2012-02-16 08:58:03 -08:00
Pieter Hintjens
d092f2615c Renamed peek/poke to get/set 2012-02-15 19:28:29 -06:00
Pieter Hintjens
dcc1725a90 Renamed zmq_getmsgopt to zmq_msg_peek
* Added zmq_msg_poke for orthogonality
* Added zmq_msg_more for simplicity
* Fixed up man pages and test program
2012-02-15 18:44:28 -06:00
Pieter Hintjens
fb4748f257 Added zmq_msg_send/recv functions 2012-02-15 15:37:35 -06:00
Pieter Hintjens
6b2ec366b1 Changed return type of zmq_msg_size to ssize_t to allow error return 2012-02-15 15:17:01 -06:00
Pieter Hintjens
0c4a19c408 Deprecated XREQ/XREP 2012-02-15 10:48:31 -06:00
Ian Barber
b6c97230ed Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-14 23:10:15 +00:00
Ian Barber
b5d3373905 Moving to std::string in options 2012-02-14 23:10:06 +00:00
skaller
4807935605 Implement type safe sockets and contexts. 2012-02-12 10:15:51 +11:00
Ian Barber
91bf4944da Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-11 15:08:23 +00:00
Ian Barber
7fa14f3823 Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-08 22:06:50 +00:00
Ian Barber
7b32c9cb51 Adding ZMQ_LAST_ENDPOINT for wildcard support on TCP and IPC sockets 2012-02-08 22:06:46 +00:00
skaller
c3f7543ebe Fix uio support.
We have to use an incomplete type in the interface.
The definition of iovec is only in the implementation.
This appears to following existing practice in 0MQ.
It seems a bit flakey that zmq.h is not included in zmq.cpp,
which is normal practice to ensure the implementation matches
the specified interface. YMMV. I follow 0MQ style.
2012-02-08 13:15:47 +11:00
skaller
970a005399 Provide interface.
Also move iovec definition from implementation to interface.
Not clear to me at present if an incomplete type should
be used to avoid gratuitously including <sys/uio.h> in
the interface. The interface can't be used with this include.
2012-02-08 12:58:35 +11:00
skaller
520ad3c2d7 Set and arrange propagation of thread safe sockets flag.
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.
2012-02-04 02:17:35 +11:00
Martin Sustrik
6f32361fea Version bumped to 3.1.1
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-19 15:43:38 +01:00
Chuck Remes
93529d8c5d Add zmq_getmsgopt to the API
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>
2011-11-06 14:03:51 +01:00
Martin Sustrik
fe81827bd0 Version changed to 3.1.0
This version downgrade is done because of the previous refatoring.
It removed all the new features and reintroduced some of the old
ones (identities). Thus, it made trunk much closer to existing 3.0
branch than it used to be.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-05 10:18:38 +01:00
Martin Sustrik
21a0b49834 Obsolete ECANTROUTE errror code removed
This error code was used only by new-style ROUTER socket
which is not a part of the codebase.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-05 10:10:44 +01:00
Martin Sustrik
d20ea25b8c ZMQ_IDENTITY option re-introduced
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-02 14:33:58 +01:00
Martin Sustrik
8e21d64c97 Copyright dates adjusted to reflect reality
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 18:06:11 +01:00
Martin Sustrik
7842c71073 LABELS and COMMANDs removed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 13:39:54 +01:00
Martin Sustrik
ac7717b7b3 250bpm copyrights added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 16:20:30 +01:00
Martin Sustrik
9227c38933 ROUTER and DEALER are aliases for XREP and XREQ
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 15:51:11 +01:00
Martin Sustrik
dee8b2360a New style ROUTER socket removed.
Signed-off-by: Martin Sustrik <sustrik@turist.(none)>
2011-10-31 15:44:42 +01:00
Martin Sustrik
940c5b346b zmq_msg_t changed to structure
zmq_msg_t being defined as unsigned char[32] could not be stored
in STL containers. Fixed by this commit.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-31 15:23:00 +02:00
Martin Sustrik
714d3b288f EAFNOSUPPORT defined on Windows platform
Windows headers don't defined this error.
This patch defines it if not already defined.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-15 20:39:48 +02:00
Steven McCoy
784041f5b9 ZMQ_IPV4ONLY option added
At this point option exists, is documented and can be set,
however, it has no effect.

Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-08 12:10:31 +02:00
Martin Sustrik
a1e09facb2 ROUTER socket reports error when message cannot be routed
Till now, message was silently dropped if it was sent to
a non-existent peer. Now, ECANTROUTE error is returned.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-21 18:54:27 +02:00
Martin Sustrik
72a793f78a ZMQ_GENERIC renamed to ZMQ_ROUTER
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-21 18:43:50 +02:00
Martin Sustrik
bf78e230ad GENERIC socket type and COMMAND flag added
GENERIC allows to use 0MQ as a dumb networking framework.
It provides user with connect/disconnect notifications.
Also, each inbound message is labeled by ID of the connection
it originated from. Outbound messages should be labeled by
the ID of the connection to send them to.

To distinguish connect/disconnect notifications from common
messages, COMMAND flag was introduced.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-17 23:31:29 +02:00
Martin Sustrik
c8e8f2a24c ZMQ_IDENTITY socket option removed
This patch simplifies the whole codebase significantly,
including dropping depedency on libuuid.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 11:24:33 +02:00
Martin Sustrik
e4f98d1e10 ROUTER and DEALER sockets removed
To be replaced by new generic socket type

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 08:16:40 +02:00
Martin Sustrik
73630de98a Version number bumped to 4.0.0
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 08:11:42 +02:00
Martin Sustrik
d7adc3f19a ZMQ_FILTER option removed
The filtering is now done depending on the socket type. SUB socket
filters the messages (end-to-end filtering) while XSUB relies
on upstream nodes to do (imprefect) filtering.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-11 09:57:59 +02:00
Martin Sustrik
a28928fe37 Introduce ZMQ_ROUTER and ZMQ_DEALER sockets
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 13:36:18 +02:00
Martin Sustrik
ab99975ad4 LABEL flag added to the wire format
So far there was no distinction between message parts used by 0MQ
and message parts used by user. Now, the message parts used by 0MQ
are marked as 'LABEL'.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 11:33:54 +02:00
Martin Sustrik
4b60023b96 Merge branch 'master' of github.com:zeromq/libzmq 2011-06-19 09:15:06 +02:00
Steven McCoy
9b795de4af Refactor Windows versioning and WinSock usage.Signed-off-by: Steven McCoy <steven.mccoy@miru.hk> 2011-06-18 20:44:03 +02:00
Fabien Ninoles
d7923f08ca Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO.
- Add doc and tests
- Add options and setup
- Wait using poll/select

Signed-off-by: Fabien Ninoles <fabien@tzone.org>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-17 12:22:02 +02:00
Martin Sustrik
ff93f54653 ZMQ_FILTER socket option added
This option is a performance tweak. In devices XSUB socket filters
the messages just to send them to XPUB socket which filters them
once more. Setting ZMQ_FILTER option to 0 allows to switch the
filtering in XSUB socket off.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-12 15:24:08 +02:00
Martin Sustrik
5d0cffc52f ZMQ_MULTICAST_HOPS socket option added
Sets the time-to-live field in every multicast packet sent from the socket.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-15 18:25:43 +02:00
Martin Sustrik
e0246e32d7 Message-related functionality factored out into msg_t class.
This patch addresses serveral issues:
1. It gathers message related functionality scattered over whole
   codebase into a single class.
2. It makes zmq_msg_t an opaque datatype. Internals of the class
   don't pollute zmq.h header file.
3. zmq_msg_t size decreases from 48 to 32 bytes. That saves ~33%
   of memory in scenarios with large amount of small messages.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-21 22:27:48 +02:00
Martin Sustrik
581697695a Message validity is checked in the runtime
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-19 08:08:15 +02:00
Martin Sustrik
0839cceac9 Missing ENOTSOCK added on Win32
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-09 09:46:59 +02:00
Martin Sustrik
abb184a051 ZMQ_NOBLOCK renamed ZMQ_DONTWAIT
Done because of POSIX compliance

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-26 10:38:40 +01:00
Martin Sustrik
bc4a1ce334 ZMQ_HWM split into ZMQ_SNDHWM and ZMQ_RCVHWM
These new options allow to control the maximum size of the
inbound and outbound message pipe separately.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 16:47:33 +01:00
Martin Sustrik
a2252de2bc ZMQ_RECOVERY_IVL and ZMQ_RECOVERY_IVL_MSEC reconciled
There's only one option now -- ZMQ_RECOVRY_IVL --
and it's measured in milliseconds.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 14:36:40 +01:00
Martin Sustrik
8463b4d55e SWAP functionality removed
On-disk storage should be implemented in devices rather than
in 0MQ core. 0MQ is a networking library and there's no point
in storing network buffers on disk.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 12:27:06 +01:00
Martin Sustrik
fb27a000d9 send/recv was changed to send/recv/sendmsg/recvmsg
send/recv now complies with POSIX by using raw buffers instead
of message objects and by returning number of bytes sent/recvd
instead of 0/-1.

The return value is changed accordingly for sendmsg and recvmsg.

Note that related man pages will be fixed in a separate patch.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 11:53:55 +01:00
Martin Sustrik
d4e83d2601 C++ binding removed from the core
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 10:18:06 +01:00
Martin Sustrik
941be8d217 zmq_device removed
Devices are basically applications on top of 0MQ stack. They
should reside in separate libraties.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-23 17:44:16 +01:00
Martin Sustrik
b45b68ae4a ZMQ_MCAST_LOOP removed
Multicast loopback is not a real multicast, rather a kernel-space
simulation. Moreover, it tends to be rather unreliable and lossy.
Removing the option will force users to use transports better
suited for the job, such as inproc or ipc.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-23 17:01:39 +01:00
Martin Sustrik
34d7854199 Obsolete constants ZMQ_UPSTREAM and ZMQ_DOWNSTREAM removed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-23 15:26:47 +01:00
Martin Sustrik
dee5f650dd Version bumped to 3.0.0
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-23 15:24:18 +01:00
Guido Goldstein
d0c8edde35 Added missing close method w/ check if socket is already closed.
Signed-off-by: Guido Goldstein <github@a-nugget.de>
2011-03-12 17:16:27 +01:00
Martin Sustrik
18b9ebea32 The copyrights in file headers updated.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02 16:30:40 +01:00
Martin Sustrik
5fcef1cac4 ZMQ_MAXMSGSIZE option added
The new option allows user to guard against peers sending
oversized messages. Connection to peer sending oversized message
is dropped.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02 09:00:36 +01:00
Martin Sustrik
820fec7f28 Version bumped to 2.2.0
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-22 21:43:52 +01:00
Thijs Terlouw
042e34a5d9 operator void* () added to context_t.
Makes it possible to share the context from C++ to C.

Signed-off-by: Thijs Terlouw <thijsterlouw@gmail.com>
2011-02-04 16:44:13 +01:00
Thijs Terlouw
f7f1dfc86d ZMQ_RECONNECT_IVL_MAX socket option added
It allows for exponential back-off strategy when reconnecting.

Signed-off-by: Thijs Terlouw <thijsterlouw@gmail.com>
2011-01-26 07:01:06 +01:00
Martin Sustrik
725ebce13c Version bumped to 2.1.1
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-01-11 21:12:51 +01:00
Min Ragan-Kelley
08cd2ce05d resolve "function declaration isn't a prototype"
change two declarations in headers to form f(void); instead of f();
which eliminates the warnings when compiling against zeromq

Signed-off-by: MinRK <benjaminrk@gmail.com>
2011-01-06 08:42:57 +01:00
Bob Beaty
fcfad5682e Added Recovery Interval in Milliseconds
For very high-speed message systems, the memory used for recovery can get to
be very large. The corrent limitation on that reduction is the ZMQ_RECOVERY_IVL
of 1 sec. I added in an additional option ZMQ_RECOVERY_IVL_MSEC, which is the
Recovery Interval in milliseconds. If used, this will override the previous
one, and allow you to set a sub-second recovery interval. If not set, the
default behavior is to use ZMQ_RECOVERY_IVL.

Signed-off-by: Bob Beaty <rbeaty@peak6.com>
2010-12-09 21:42:58 +01:00
Martin Sustrik
c80e7b80cc XPUB and XSUB socket types added.
These are just placeholders. At the moment XPUB behaves th same
as PUB and XSUB as SUB.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-12-04 23:14:38 +01:00
Mikko Koppanen
5bb0a339be Prefix variables with "ac_zmq_"
- Added a macro for checking clang compiler
 - Moved basic compiler checks to a macro
 - Added a macro for checking if compiler supports a flag
 - Added --enable-debug flag
 - Added a macro for running normal autoconf check with compiler flags
 - Added a macro for checking for verbose flag for different compilers (-Wall)
 - Added a macro for turning on strict standards compliance
 - Added a macro for turning warnings to errors
 - Added a macro for checking if compiler supports given pragma
 - Most of the flags now go through checks if the compilers supports them
   rather than enumerating different compilers
 - Added DSO symbol visibility for sun compiler
 - Enabled verbose mode for sun compiler
 - Fixed build for ICC 12.x by adding -wd279 to size_t checks
 - Removed pkg-config checks as those don't seem to be used anywhere

Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2010-12-01 10:33:07 +01:00
Martin Lucina
c9584096e0 Control symbol exports using -fvisibility
On systems using GCC 4.0 or newer which support symbol visibility in shared
libraries, use -fvisibility=hidden and only export explict API functions
defined in zmq.cpp. We do not enable -fvisibility on MinGW since this uses a
separate mechanism (__declspec).

Signed-off-by: Martin Lucina <mato@kotelna.sk>
2010-11-25 17:12:31 +01:00
Martin Sustrik
b358df9fff Name of "GNU Lesser Public License" corrected.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-30 15:08:28 +02:00
Peter Bourgon
9384faf7e5 Add function to zmq::error_t to access errnum
Signed-off-by: Peter Bourgon <peter.bourgon@gmail.com>
2010-10-29 08:16:59 +02:00
Burak Arslan
3eb935ef6e switch to c++-specific headers
Signed-off-by: Burak Arslan <burak-github@arskom.com.tr>
2010-10-28 08:41:28 +02:00
Martin Sustrik
a780833683 ZMQ_BACKLOG socket option added.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-17 10:23:58 +02:00
Martin Sustrik
e8e2944f45 ZMQ_RECONNECT_IVL socket options added.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-17 09:54:12 +02:00
Martin Sustrik
0a03e86e95 ZMQ_LINGER socket option added.
1. ZMQ_LINGER option can be set/get
    2. options are part of own_t base class rather than being declared
       separately by individual objects
    3. Linger option is propagated with "term" command so that the
       newest value of it is used rather than the stored old one.
    4. Session sets the linger timer if needed and terminates
       as soon as it expires.
    5. Corresponding documentation updated.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-16 10:53:29 +02:00
Martin Sustrik
eeb8e7c8be Merge branch 'maint'
* maint:
  Makefile.am: Add missing files to distribution, improve maintainer-clean
  configure.in: Extract API version from zmq.h
  Added bin directory to ignore list.

Conflicts:
	configure.in
	include/zmq.h
2010-10-15 17:13:36 +02:00
Martin Lucina
3b3df731e6 configure.in: Extract API version from zmq.h
* Added a version.sh and relevant changes to configure.in to extract the API
  version from zmq.h at the time autogen.sh is run.
* Moved the version macros to be next to zmq_version in zmq.h and improved
  the comments.
* Modified ZMQ_MAKE_VERSION to use (x) instead of plain x when expanding
  macro parameters.

Signed-off-by: Martin Lucina <mato@kotelna.sk>
2010-10-15 16:53:15 +02:00
Martin Sustrik
318cdd1f24 Merge branch 'maint'
* maint:
  Version macros added

Conflicts:
	builds/msvc/platform.hpp

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-09 08:03:58 +02:00
Martin Sustrik
ef8db789a1 Version macros added
Macro ZMQ_VERSION represents the current version of 0MQ
Macro ZMQ_MAKE_VERSION(major,minor,patch) allows to create
a representation of the specified version.
The versions can be compared using simple <, >, ==, etc.
operators.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-09 07:53:24 +02:00
Ilja Golshtein
ec2e85919e C++ binding destructors don't throw exceptions 2010-09-30 09:11:51 +02:00
Gonzalo Diethelm
87beaaa00d ZMQ_TYPE socket option added 2010-09-28 15:27:45 +02:00
Martin Sustrik
a68e6739f4 when no I/O threads are available error is raised instead of assertion 2010-09-09 08:25:00 +02:00
Martin Sustrik
47e87b7e4b EMTHREAD error code returned to zmq.h to ensure backward compatibility 2010-09-08 15:45:59 +02:00
Martin Sustrik
76f2e5d544 Merge branch 'maint'
* maint:
  Broken device numbering reverted
  assert on malformed messages
  forwarder and streamer devices handle multi-part messages correctly
  improved null checking in zmq_term

Conflicts:
	AUTHORS
	include/zmq.h
	src/zmq.cpp
2010-09-04 17:19:38 +02:00
Martin Sustrik
db7fe858d6 Broken device numbering reverted 2010-09-04 17:12:08 +02:00
Martin Lucina
ca176121de Merge branch 'maint'
* maint:
  zmq::select_t, zmq_poll(): assert if FD_SETSIZE reached
  zmq.h: Fix typo and use of C99 comment

Conflicts:
	src/zmq.cpp
2010-09-04 16:24:21 +02:00
Martin Lucina
f850190c16 zmq.h: Fix typo and use of C99 comment 2010-09-04 16:10:14 +02:00
Martin Sustrik
05d908492d WIP: Socket migration between threads, new zmq_close() semantics
Sockets may now be migrated between OS threads; sockets may not be used by
more than one thread at any time. To migrate a socket to another thread the
caller must ensure that a full memory barrier is called before using the
socket from the target thread.

The new zmq_close() semantics implement the behaviour discussed at:

http://lists.zeromq.org/pipermail/zeromq-dev/2010-July/004244.html

Specifically, zmq_close() is now deterministic and while it still returns
immediately, it does not discard any data that may still be queued for
sending. Further, zmq_term() will now block until all outstanding data has
been sent.

TODO: Many bugs have been introduced, needs testing. Further, SO_LINGER or
an equivalent mechanism (possibly a configurable timeout to zmq_term())
needs to be implemented.
2010-08-25 15:39:20 +02:00
Pieter Hintjens
11a410b658 Renamed ZMQ_UPSTREAM to ZMQ_PULL, and ZMQ_DOWNSTREAM to ZMQ_PUSH. Left the old
definitions as aliases, to be removed in release 3.0.  Also renamed the source
files implementing these two socket types.  This change does not break existing
applications nor bindings, but allows us to fix the documentation and user guide
now, rather than keeping the old (confusing) names.
2010-08-04 14:38:56 +02:00
Martin Sustrik
cff7ba2315 Windows build fixed 2010-06-17 17:09:51 +02:00
Martin Sustrik
7f01e9970d stopwatch returned to libzmq 2010-06-17 16:51:53 +02:00
Martin Sustrik
67ca7dcbe6 obsolete API elements removed - this commit breaks backward compatibility 2010-06-04 15:24:06 +02:00
Martin Lucina
606c77368c Move perf helper functions to perf/helpers.cpp 2010-06-04 14:48:49 +02:00
Martin Sustrik
8408ae066d LWM is computed rather than explicitly specified by user 2010-05-25 15:03:57 +02:00
Martin Sustrik
c193fd1466 lock-free polling removed; ZMQ_POLL flag removed 2010-04-29 17:20:23 +02:00
Martin Sustrik
beffee92a8 P2P renamed to PAIR 2010-04-26 16:51:05 +02:00
Martin Sustrik
1c33941be9 Merge branch 'master' of git@github.com:sustrik/zeromq2 2010-04-15 07:32:49 +02:00
Martin Sustrik
ea18d30c20 atomic_ptr fix of Win64 2010-04-15 07:32:25 +02:00
Martin Lucina
0024d29076 Build fixes for cross compiling and Win32 2010-04-12 16:49:13 +02:00
Martin Sustrik
fba28c7c0c issue 1 - Change zmq_term semantics 2010-04-11 16:36:27 +02:00
Martin Sustrik
6cf076510a C-style comments in zmq.h 2010-04-11 14:00:40 +02:00
Martin Sustrik
00cf3ceb8d multi-part message functionality available via ZMQ_SNDMORE and ZMQ_RCVMORE 2010-04-11 10:26:47 +02:00
Martin Sustrik
6fea422583 getsockopt added to c++ binding 2010-04-11 07:59:03 +02:00
Martin Sustrik
716f4ac871 zmq_getsockopt function added 2010-04-09 13:04:15 +02:00
Jon Dyte
edfd05df8e devices can be created via API 2010-04-07 08:20:01 +02:00
Martin Sustrik
2f219d7c28 ZMQ_TBC renamed to ZMQ_MORE 2010-03-27 21:25:40 +01:00
Martin Sustrik
842b4dd2e4 muti-part message functionality available via API 2010-03-27 14:57:56 +01:00
Martin Sustrik
8d8e0857be as advertised, zmq_flush and ZMQ_NOFLUSH were removed 2010-03-27 14:50:35 +01:00
Martin Sustrik
61ad236e95 ZMQ_NOFLUSH and zmq_flush obsoleted 2010-03-13 14:40:10 +01:00
Martin Lucina
27e2d08449 Restructure language bindings
C and C++ headers moved from bindings/ to include/, bindings/ removed
--with-c and --with-cpp options to configure removed, C and C++ now built
and installed by default
2010-03-11 20:33:27 +01:00
malosek
b71c3005e6 include directory split into c and cpp dirs, added --with-c and --with-cpp configure options 2009-09-07 17:06:47 +02:00
unknown
f895426c18 initial changes for win port 2009-09-07 15:41:43 +02:00
Martin Sustrik
6a5120b1f1 python extension & perf tests 2009-09-02 10:22:23 +02:00
Martin Sustrik
314deb6185 build system for perf/C and perf/C++ 2009-08-30 15:47:39 +02:00
Martin Sustrik
6996ef6f1a improved error handling 2009-08-29 09:41:50 +02:00
Martin Sustrik
99c5d92836 pipes added 2009-08-27 10:54:28 +02:00
Martin Sustrik
6be4b01437 session management implemented 2009-08-21 14:29:22 +02:00
Martin Sustrik
131f2e3096 subscribe API removed 2009-08-17 14:07:34 +02:00
Martin Sustrik
059beca59d listener/connecter/init/session added 2009-08-12 09:40:16 +02:00
Martin Sustrik
3147ff8523 getsockopt implemented 2009-08-09 11:57:21 +02:00
Martin Sustrik
5b5b513330 socket options interface modeled as in BSD sockets 2009-08-09 09:24:48 +02:00
Martin Sustrik
a8b410e66c lockfree interaction patter for 3 theads implemented 2009-08-08 16:01:58 +02:00
Martin Hurton
43fa72b7ee C++ binding uses exceptions to signal failure 2009-08-03 11:59:55 +02:00
Martin Sustrik
cc3755a16f renamed from zs to zmq 2009-08-03 11:30:13 +02:00
Martin Sustrik
4ed70a9302 initial commit 2009-07-29 12:07:54 +02:00