![]() |
libzmq master
The Intelligent Transport Layer
|
00001 /* 00002 Copyright (c) 2009-2011 250bpm s.r.o. 00003 Copyright (c) 2007-2010 iMatix Corporation 00004 Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file 00005 00006 This file is part of 0MQ. 00007 00008 0MQ is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 0MQ is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public License 00019 along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 #ifndef __ZMQ_PULL_HPP_INCLUDED__ 00023 #define __ZMQ_PULL_HPP_INCLUDED__ 00024 00025 #include "socket_base.hpp" 00026 #include "session_base.hpp" 00027 #include "fq.hpp" 00028 00029 namespace zmq 00030 { 00031 00032 class pull_t : 00033 public socket_base_t 00034 { 00035 public: 00036 00037 pull_t (class ctx_t *parent_, uint32_t tid_); 00038 ~pull_t (); 00039 00040 protected: 00041 00042 // Overloads of functions from socket_base_t. 00043 void xattach_pipe (class pipe_t *pipe_); 00044 int xrecv (class msg_t *msg_, int flags_); 00045 bool xhas_in (); 00046 void xread_activated (class pipe_t *pipe_); 00047 void xterminated (class pipe_t *pipe_); 00048 00049 private: 00050 00051 // Fair queueing object for inbound pipes. 00052 fq_t fq; 00053 00054 pull_t (const pull_t&); 00055 const pull_t &operator = (const pull_t&); 00056 00057 }; 00058 00059 class pull_session_t : public session_base_t 00060 { 00061 public: 00062 00063 pull_session_t (class io_thread_t *io_thread_, bool connect_, 00064 class socket_base_t *socket_, const options_t &options_, 00065 const char *protocol_, const char *address_); 00066 ~pull_session_t (); 00067 00068 private: 00069 00070 pull_session_t (const pull_session_t&); 00071 const pull_session_t &operator = (const pull_session_t&); 00072 }; 00073 00074 } 00075 00076 #endif