summaryrefslogtreecommitdiff
path: root/src/socket_base.cpp
AgeCommit message (Collapse)Author
2011-12-16zmq_sendmsg and zmq_recvmsg checks for NULL message objectMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-06Add zmq_getmsgopt to the APIChuck Remes
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-05Use identities in inproc transportMartin Sustrik
Previous patches have missed the case when the identity should be sent from an inproc endpoint. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-04Identities re-introducedMartin Sustrik
However, the "durable socket" behaviour wasn't re-added. Identities are used solely for routing in REQ/REP pattern. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01Copyright dates adjusted to reflect realityMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01LABELS and COMMANDs removedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31VTCP transport removedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31250bpm copyrights addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31New style ROUTER socket removed.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@turist.(none)>
2011-09-15Session class separated into socket-type-specific sessionsMartin Sustrik
This is a preliminary patch allowing for socket-type-specific functionality in the I/O thread. For example, message format can be checked asynchronously and misbehaved connections dropped straight away. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-09-01Fixed warnings on Win64Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-28Dead code removed from TCP and IPC transportsMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-28Implementations of TCP and IPC transports separatedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-26Experimental VTCP listener addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-26TCP transport classes simplifiedMartin Sustrik
zmq_engine and tcp_socket merged into tcp_engine zmq_connecter and tcp_connecter merged into tcp_connecter zmq_listener and tcp_listener merged into tcp_listener Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-24Session classes merged into a single classMartin Sustrik
Removal of ZMQ_IDENTITY resulted in various session classes doing almost the same thing. This patch merges the classes into a single class. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-21ZMQ_GENERIC renamed to ZMQ_ROUTERMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-17GENERIC socket type and COMMAND flag addedMartin Sustrik
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-15ZMQ_IDENTITY socket option removedMartin Sustrik
This patch simplifies the whole codebase significantly, including dropping depedency on libuuid. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15non-immediate_connect functionality removedMartin Sustrik
It was used only by ROUTER socket. After its removal it became obsolete. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15ROUTER and DEALER sockets removedMartin Sustrik
To be replaced by new generic socket type 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-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-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-20Fix minor warning in MSVC buildMartin 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-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-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-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-04-29Substantial simplification of uuid_tMartin Sustrik
The string format of UUID is not used in 0MQ. Further on, it turns out that UUIDs have fixed microarchitecture-agnostic binary layout (see RFC4122). Thus, the conversion to string and back to binary can be avoided. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-21Message-related functionality factored out into msg_t class.Martin Sustrik
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-19Message validity is checked in the runtimeMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-09Run-time checking for context & socket validity addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-26ZMQ_NOBLOCK renamed ZMQ_DONTWAITMartin Sustrik
Done because of POSIX compliance Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24ZMQ_HWM split into ZMQ_SNDHWM and ZMQ_RCVHWMMartin Sustrik
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-24ZMQ_HWM type changed to intMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24ZMQ_EVENTS type changed to intMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24ZMQ_RCVMORE type changed to intMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24SWAP functionality removedMartin Sustrik
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-16Duplicate identities now checked with zmq_connectMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02The copyrights in file headers updated.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-01Explicit identities bug in inproc transport fixed.Martin Sustrik
The identity of bound socket was not used. Instead, transient identity was generated. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-25Socket with no owner objects is deallocated immediatelyMartin Sustrik
Till now the deallocation of such socket was delayed till zmq_term() thus creating a "leak". Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-22Added explicit error message in case of memory exhaustionMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-09Reaper thread waits for commands rather them retrieving them periodicallyMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-09Initial implementation of reaper thread.Martin Sustrik
Reaper thread destroys the socket asynchronously. zmq_term() can be interrupted by a signal (EINTR). zmq_socket() will return ETERM after zmq_term() was called. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>