diff options
Diffstat (limited to 'src/zmq_engine.hpp')
-rw-r--r-- | src/zmq_engine.hpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/zmq_engine.hpp b/src/zmq_engine.hpp index ad739c7..38a390d 100644 --- a/src/zmq_engine.hpp +++ b/src/zmq_engine.hpp @@ -21,6 +21,9 @@ #define __ZMQ_ZMQ_ENGINE_HPP_INCLUDED__ #include "io_object.hpp" +#include "tcp_socket.hpp" +#include "zmq_encoder.hpp" +#include "zmq_decoder.hpp" namespace zmq { @@ -29,14 +32,36 @@ namespace zmq { public: - zmq_engine_t (class io_thread_t *parent_, object_t *owner_); + zmq_engine_t (class io_thread_t *parent_, fd_t fd_); + ~zmq_engine_t (); + + void plug (struct i_inout *inout_); + void unplug (); + + // i_poll_events interface implementation. + void in_event (); + void out_event (); private: - ~zmq_engine_t (); + // Function to handle network disconnections. + void error (); + + tcp_socket_t tcp_socket; + handle_t handle; + + unsigned char *inbuf; + int insize; + int inpos; + + unsigned char *outbuf; + int outsize; + int outpos; + + i_inout *inout; - // Handlers for incoming commands. - void process_plug (); + zmq_encoder_t encoder; + zmq_decoder_t decoder; zmq_engine_t (const zmq_engine_t&); void operator = (const zmq_engine_t&); |