summaryrefslogtreecommitdiff
path: root/src/xreq.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-05-22 17:26:53 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-22 17:26:53 +0200
commitacf0b0e515515e51ad32ba7a2d147ce703579478 (patch)
treed2032009cf46c23aa0f677c2216914f718ab968a /src/xreq.hpp
parent9e6b39925603f9e64db08c469bd628d7ef9465de (diff)
Introduces bi-directional pipes
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>
Diffstat (limited to 'src/xreq.hpp')
-rw-r--r--src/xreq.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/xreq.hpp b/src/xreq.hpp
index e0cafe5..a75e5c8 100644
--- a/src/xreq.hpp
+++ b/src/xreq.hpp
@@ -23,13 +23,16 @@
#define __ZMQ_XREQ_HPP_INCLUDED__
#include "socket_base.hpp"
+#include "pipe.hpp"
#include "fq.hpp"
#include "lb.hpp"
namespace zmq
{
- class xreq_t : public socket_base_t
+ class xreq_t :
+ public socket_base_t,
+ public i_pipe_events
{
public:
@@ -39,8 +42,7 @@ namespace zmq
protected:
// Overloads of functions from socket_base_t.
- void xattach_pipes (class reader_t *inpipe_, class writer_t *outpipe_,
- const blob_t &peer_identity_);
+ void xattach_pipe (class pipe_t *pipe_, const blob_t &peer_identity_);
int xsend (class msg_t *msg_, int flags_);
int xrecv (class msg_t *msg_, int flags_);
bool xhas_in ();
@@ -48,6 +50,11 @@ namespace zmq
private:
+ // i_pipe_events interface implementation.
+ void read_activated (pipe_t *pipe_);
+ void write_activated (pipe_t *pipe_);
+ void terminated (pipe_t *pipe_);
+
// Hook into the termination process.
void process_term (int linger_);