summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2011-07-11PGM transport reconciled with subscription forwardingMartin Sustrik
As PGM is not capable of passing subscriptions upstream, subscriptions are ignored at sub side and engine subscribes for all messages on pub side. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-11ZMQ_FILTER option removedMartin Sustrik
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-11Experimental code from zmq_init_t removed.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-09Drop outbound messages in XREP socket when SNDHWM is reachedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-08VSM data are aligned to 32/64 bit boundaryMartin Sustrik
Till now the VSM buffer was aligned to 16 bit boundary which could possibly cause problems on RISC architectures when accessing the message data in unsafe manner. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03Merge branch 'master' of github.com:zeromq/libzmqMartin Sustrik
2011-07-03Race condition in eventfd signaler fixedMartin Sustrik
recv function on eventfd signaler could accidentally grab two signals instead of one. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03eventfd implementation of the signalerMartin Sustrik
Eventfd (on Linux) is more efficient that socketpair for passing simple signals. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03Fix MSVC buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-03Command are now stored in ypipes instead of in socketpairsMartin Sustrik
Storing commands in OS socket buffers caused whole lot of problems when free space in the buffer ran out. This patch stores commands in ypipes instead and uses socketpair just to signal the other thread, ie. at most one byte is stored in the socketpair at any single instant. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-30Testing for errors from pthread_* functions fixedMartin Sustrik
pthread_* functions return the error number rather than setting errno. This was not accounter for till now. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-29Use strrchr to ensure we split off the last colon for the service portAndrew Thompson
IPv6 addresses have colons and will produce invalid data for the getaddrinfo lookup. Signed-off-by: Andrew Thompson <andy@fud.org.nz>
2011-06-27Rename i_inout to i_engine_sinkMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-23Fix MSVC buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-23Outstanding requests dropped when requester dies (issue 190)Martin Sustrik
So far the requests in req/rep pattern were delivered to and processed by worker even though the original requester was dead. Thus, the worker processing replies with noone to deliver results to. This optimisation drops requests in two situations: 1. Queued inbound requests in XREP socket when peer disconnects. 2. Queued outbound requests in XREQ when socket is closed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-22O(1) fair-queueing in XREP implementedMartin Sustrik
Up to now the complexity of fair-queueing in XREP was O(n). Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-22New wire format for REQ/REP patternMartin Sustrik
This patch introduces two changes: 1. 32-bit ID is used to identify the peer instead of UUID 2. REQ socket seeds the label stack with unique 32-bit request ID It also drops any replies with non-matching request ID Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-21Unspecified error code from mailbox_t::recv on Win32 fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20Introduce ZMQ_ROUTER and ZMQ_DEALER socketsMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20LABEL flag added to the wire formatMartin Sustrik
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-20Bug fixed in pipe terminationMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20Optimise block/non-block switching in mailbox_tFabien Ninoles
For the platforms that don't support MSG_DONTWAIT the reader socket in mailbox_t was kept in non-blocking state and flipped to blocking state and back when blocking read was requested. Now, the state is preserved between calls and flipped only if different type of operation (block vs. non-block) is requested. Signed-off-by: Fabien Ninoles <fabien@tzone.org> Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20Fix minor warning in MSVC buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19Mailbox timeouts fixed on WindowsMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19Session termination error fixedMartin Sustrik
When session is already terminating and reconnection happens at that point, the session should not create new pipe to its socket. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19Race condition in pipe_t fixed.Martin Sustrik
pipe_t now correctly drops pointer to the underlying pipe when sending pipe_term_ack command. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19ENETDOWN is a legal error from TCP connectMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19Merge branch 'master' of github.com:zeromq/libzmqMartin Sustrik
2011-06-18Refactor Windows versioning and WinSock usage.Signed-off-by: Steven McCoy ↵Steven McCoy
<steven.mccoy@miru.hk>
2011-06-18Minor MSVC warning fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-17Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO.Fabien Ninoles
- 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-14ENETUNREACH is a valid error from connectMartin Sustrik
This patch fixed the JIRA issue 223 Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-13Minor patch to fix ICC buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-13Reverting previous commit that broke MSVC2010 buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-12Fix scope on Windows includes.Steven McCoy
Fix windows.h included before winsock2.h. Remove definition of _WINSOCKAPI_. Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
2011-06-12ZMQ_FILTER socket option addedMartin Sustrik
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-12Publisher-side filtering for multi-part messages fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-11Actual message filtering happens in XPUB socketMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-01Minor code beautification for mtrie_tMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-31Subscriptions are processed immediately in XPUB socketMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-31Session termination induced by socket fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-30Patches from sub-forward branch incorporatedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-28Subscription matching moved from XSUB to SUB socketMartin Sustrik
This patch will prevent duplicate matching in devices in the future. Instead of matching in both XPUB and XSUB, it'll happen only in XPUB. Receiver endpoint will still filter messages via SUB socket. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-26Pending messages are delivered even if connection doesn't exist yetMartin Sustrik
Bug in previous refactoring fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-25All pipe termination code moved to pipe_tMartin Sustrik
Till now the code was spread over mutliple locations. Additionally, the code was made more formally correct, with explicit pipe state machine etc. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-23Add multi-array support to array_item_t.Fabien Ninoles
Allow to have the same item part of two different arrays, as long as they are using different array identifier.
2011-05-23Move the pipe termination code to socket_base_tMartin Sustrik
So far, the pipe termination code was spread among socket type classes, fair queuer, load balancer, etc. This patch moves all the associated logic to a single place. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-22Introduces bi-directional pipesMartin Sustrik
So far, there was a pair of unidirectional pipes between a socket and a session (or an inproc peer). This resulted in complex problems with half-closed states and tracking which inpipe corresponds to which outpipe. This patch doesn't add any functionality in itself, but is essential for further work on features like subscription forwarding. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-17Couple of minor issues in MSVC build fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-17Better handling of memory error in resolve_ip_hostnamePaul Colomiets
Signed-off-by: Paul Colomiets <pc@gafol.net>