![]()  | 
  
    libzmq
    master
    
   ZeroMQ C++ Core Engine (LIBZMQ) 
   | 
 
#include <session_base.hpp>


Public Member Functions | |
| void | attach_pipe (zmq::pipe_t *pipe_) | 
| void | engine_error (zmq::stream_engine_t::error_reason_t reason) | 
| void | flush () | 
| socket_base_t * | get_socket () | 
| void | hiccuped (zmq::pipe_t *pipe_) | 
| void | pipe_terminated (zmq::pipe_t *pipe_) | 
| virtual int | pull_msg (msg_t *msg_) | 
| virtual int | push_msg (msg_t *msg_) | 
| void | read_activated (zmq::pipe_t *pipe_) | 
| int | read_zap_msg (msg_t *msg_) | 
| virtual void | reset () | 
| void | write_activated (zmq::pipe_t *pipe_) | 
| int | write_zap_msg (msg_t *msg_) | 
| int | zap_connect () | 
| bool | zap_enabled () | 
  Public Member Functions inherited from zmq::own_t | |
| own_t (zmq::ctx_t *parent_, uint32_t tid_) | |
| own_t (zmq::io_thread_t *io_thread_, const options_t &options_) | |
| void | inc_seqnum () | 
| void | register_term_acks (int count_) | 
| void | unregister_term_ack () | 
  Public Member Functions inherited from zmq::object_t | |
| object_t (zmq::ctx_t *ctx_, uint32_t tid_) | |
| object_t (object_t *parent_) | |
| virtual | ~object_t () | 
| ctx_t * | get_ctx () | 
| uint32_t | get_tid () | 
| void | process_command (zmq::command_t &cmd_) | 
| void | send_bind (zmq::own_t *destination_, zmq::pipe_t *pipe_, bool inc_seqnum_=true) | 
| void | send_inproc_connected (zmq::socket_base_t *socket_) | 
| void | set_tid (uint32_t id) | 
  Public Member Functions inherited from zmq::io_object_t | |
| io_object_t (zmq::io_thread_t *io_thread_=NULL) | |
| ~io_object_t () | |
| void | plug (zmq::io_thread_t *io_thread_) | 
| void | unplug () | 
  Public Member Functions inherited from zmq::i_poll_events | |
| virtual | ~i_poll_events () | 
  Public Member Functions inherited from zmq::i_pipe_events | |
| virtual | ~i_pipe_events () | 
Static Public Member Functions | |
| static session_base_t * | create (zmq::io_thread_t *io_thread_, bool active_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_) | 
Protected Member Functions | |
| session_base_t (zmq::io_thread_t *io_thread_, bool active_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_) | |
| virtual | ~session_base_t () | 
  Protected Member Functions inherited from zmq::own_t | |
| virtual | ~own_t () | 
| bool | is_terminating () | 
| void | launch_child (own_t *object_) | 
| virtual void | process_destroy () | 
| void | term_child (own_t *object_) | 
| void | terminate () | 
  Protected Member Functions inherited from zmq::object_t | |
| zmq::io_thread_t * | choose_io_thread (uint64_t affinity_) | 
| void | connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_) | 
| void | destroy_socket (zmq::socket_base_t *socket_) | 
| zmq::endpoint_t | find_endpoint (const char *addr_) | 
| void | log (const char *format_,...) | 
| void | pend_connection (const std::string &addr_, const endpoint_t &endpoint, pipe_t **pipes_) | 
| virtual void | process_activate_read () | 
| virtual void | process_activate_write (uint64_t msgs_read_) | 
| virtual void | process_bind (zmq::pipe_t *pipe_) | 
| virtual void | process_hiccup (void *pipe_) | 
| virtual void | process_pipe_term () | 
| virtual void | process_pipe_term_ack () | 
| virtual void | process_reap (zmq::socket_base_t *socket_) | 
| virtual void | process_reaped () | 
| virtual void | process_stop () | 
| int | register_endpoint (const char *addr_, const zmq::endpoint_t &endpoint_) | 
| void | send_activate_read (zmq::pipe_t *destination_) | 
| void | send_activate_write (zmq::pipe_t *destination_, uint64_t msgs_read_) | 
| void | send_attach (zmq::session_base_t *destination_, zmq::i_engine *engine_, bool inc_seqnum_=true) | 
| void | send_done () | 
| void | send_hiccup (zmq::pipe_t *destination_, void *pipe_) | 
| void | send_own (zmq::own_t *destination_, zmq::own_t *object_) | 
| void | send_pipe_term (zmq::pipe_t *destination_) | 
| void | send_pipe_term_ack (zmq::pipe_t *destination_) | 
| void | send_plug (zmq::own_t *destination_, bool inc_seqnum_=true) | 
| void | send_reap (zmq::socket_base_t *socket_) | 
| void | send_reaped () | 
| void | send_stop () | 
| void | send_term (zmq::own_t *destination_, int linger_) | 
| void | send_term_ack (zmq::own_t *destination_) | 
| void | send_term_req (zmq::own_t *destination_, zmq::own_t *object_) | 
| int | unregister_endpoint (const std::string &addr_, socket_base_t *socket_) | 
| void | unregister_endpoints (zmq::socket_base_t *socket_) | 
  Protected Member Functions inherited from zmq::io_object_t | |
| handle_t | add_fd (fd_t fd_) | 
| void | add_timer (int timout_, int id_) | 
| void | cancel_timer (int id_) | 
| void | in_event () | 
| void | out_event () | 
| void | reset_pollin (handle_t handle_) | 
| void | reset_pollout (handle_t handle_) | 
| void | rm_fd (handle_t handle_) | 
| void | set_pollin (handle_t handle_) | 
| void | set_pollout (handle_t handle_) | 
Private Types | |
| enum | { linger_timer_id = 0x20 } | 
Private Member Functions | |
| session_base_t (const session_base_t &) | |
| void | clean_pipes () | 
| const session_base_t & | operator= (const session_base_t &) | 
| void | process_attach (zmq::i_engine *engine_) | 
| void | process_plug () | 
| void | process_term (int linger_) | 
| void | reconnect () | 
| void | start_connecting (bool wait_) | 
| void | timer_event (int id_) | 
Private Attributes | |
| const bool | active | 
| address_t * | addr | 
| zmq::i_engine * | engine | 
| bool | has_linger_timer | 
| bool | incomplete_in | 
| zmq::io_thread_t * | io_thread | 
| bool | pending | 
| zmq::pipe_t * | pipe | 
| zmq::socket_base_t * | socket | 
| std::set< pipe_t * > | terminating_pipes | 
| zmq::pipe_t * | zap_pipe | 
Additional Inherited Members | |
  Protected Types inherited from zmq::io_object_t | |
| typedef poller_t::handle_t | handle_t | 
  Protected Attributes inherited from zmq::own_t | |
| options_t | options | 
Definition at line 51 of file session_base.hpp.
      
  | 
  private | 
| Enumerator | |
|---|---|
| linger_timer_id | |
Definition at line 158 of file session_base.hpp.
      
  | 
  protected | 
Definition at line 97 of file session_base.cpp.
      
  | 
  protectedvirtual | 
Definition at line 115 of file session_base.cpp.
References addr, zmq::io_object_t::cancel_timer(), engine, has_linger_timer, LIBZMQ_DELETE, linger_timer_id, pipe, zmq::i_engine::terminate(), zap_pipe, and zmq_assert.

      
  | 
  private | 
| void zmq::session_base_t::attach_pipe | ( | zmq::pipe_t * | pipe_ | ) | 
Definition at line 133 of file session_base.cpp.
References zmq::own_t::is_terminating(), pipe, zmq::pipe_t::set_event_sink(), and zmq_assert.
Referenced by zmq::socket_base_t::connect().


      
  | 
  private | 
Definition at line 211 of file session_base.cpp.
References zmq::msg_t::close(), errno_assert, zmq::pipe_t::flush(), incomplete_in, zmq::msg_t::init(), pipe, pull_msg(), zmq::pipe_t::rollback(), and zmq_assert.
Referenced by engine_error().


      
  | 
  static | 
Definition at line 53 of file session_base.cpp.
References alloc_assert, zmq::options_t::type, ZMQ_CLIENT, ZMQ_DEALER, ZMQ_DISH, ZMQ_GATHER, ZMQ_PAIR, ZMQ_PUB, ZMQ_PULL, ZMQ_PUSH, ZMQ_RADIO, ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_SCATTER, ZMQ_SERVER, ZMQ_STREAM, ZMQ_SUB, ZMQ_XPUB, and ZMQ_XSUB.
Referenced by zmq::socket_base_t::connect(), zmq::tcp_listener_t::in_event(), and zmq::ipc_listener_t::in_event().

| void zmq::session_base_t::engine_error | ( | zmq::stream_engine_t::error_reason_t | reason | ) | 
Definition at line 413 of file session_base.cpp.
References active, zmq::pipe_t::check_read(), clean_pipes(), zmq::stream_engine_t::connection_error, engine, pipe, zmq::stream_engine_t::protocol_error, reconnect(), zmq::own_t::terminate(), zmq::stream_engine_t::timeout_error, zap_pipe, and zmq_assert.
Referenced by zmq::stream_engine_t::error().


| void zmq::session_base_t::flush | ( | ) | 
Definition at line 205 of file session_base.cpp.
References zmq::pipe_t::flush(), and pipe.
Referenced by zmq::stream_engine_t::error(), zmq::udp_engine_t::in_event(), zmq::stream_engine_t::in_event(), zmq::stream_engine_t::mechanism_ready(), zmq::stream_engine_t::plug(), and zmq::stream_engine_t::restart_input().


| zmq::socket_base_t * zmq::session_base_t::get_socket | ( | ) | 
Definition at line 309 of file session_base.cpp.
References socket.
Referenced by zmq::socks_connecter_t::socks_connecter_t(), and zmq::tcp_connecter_t::tcp_connecter_t().

      
  | 
  virtual | 
Implements zmq::i_pipe_events.
Definition at line 302 of file session_base.cpp.
References zmq_assert.
      
  | 
  private | 
      
  | 
  virtual | 
Implements zmq::i_pipe_events.
Definition at line 232 of file session_base.cpp.
References zmq::io_object_t::cancel_timer(), engine, has_linger_timer, zmq::own_t::is_terminating(), linger_timer_id, zmq::own_t::options, pending, pipe, zmq::own_t::process_term(), zmq::options_t::raw_socket, zmq::i_engine::terminate(), zmq::own_t::terminate(), terminating_pipes, zap_pipe, and zmq_assert.

      
  | 
  privatevirtual | 
Reimplemented from zmq::object_t.
Definition at line 374 of file session_base.cpp.
References zmq::options_t::conflate, engine, errno_assert, io_thread, zmq::own_t::is_terminating(), zmq::own_t::options, pipe, zmq::pipepair(), zmq::i_engine::plug(), zmq::options_t::rcvhwm, zmq::object_t::send_bind(), zmq::pipe_t::set_event_sink(), zmq::options_t::sndhwm, socket, zmq::options_t::type, zmq_assert, ZMQ_DEALER, ZMQ_PUB, ZMQ_PULL, ZMQ_PUSH, and ZMQ_SUB.

      
  | 
  privatevirtual | 
Reimplemented from zmq::object_t.
Definition at line 314 of file session_base.cpp.
References active, and start_connecting().

      
  | 
  privatevirtual | 
Reimplemented from zmq::own_t.
Definition at line 448 of file session_base.cpp.
References zmq::io_object_t::add_timer(), zmq::pipe_t::check_read(), engine, has_linger_timer, linger_timer_id, pending, pipe, zmq::own_t::process_term(), zmq::pipe_t::terminate(), terminating_pipes, zap_pipe, and zmq_assert.

Reimplemented in zmq::dish_session_t, and zmq::radio_session_t.
Definition at line 142 of file session_base.cpp.
References zmq::msg_t::flags, incomplete_in, zmq::msg_t::more, pipe, and zmq::pipe_t::read().
Referenced by clean_pipes(), zmq::udp_engine_t::out_event(), zmq::stream_engine_t::pull_and_encode(), zmq::radio_session_t::pull_msg(), zmq::dish_session_t::pull_msg(), zmq::stream_engine_t::pull_msg_from_session(), and zmq::udp_engine_t::restart_output().


Reimplemented in zmq::dish_session_t, zmq::req_session_t, and zmq::radio_session_t.
Definition at line 154 of file session_base.cpp.
References zmq::msg_t::command, errno_assert, zmq::msg_t::flags, zmq::msg_t::init(), pipe, and zmq::pipe_t::write().
Referenced by zmq::stream_engine_t::decode_and_push(), zmq::udp_engine_t::in_event(), zmq::stream_engine_t::mechanism_ready(), zmq::stream_engine_t::process_identity_msg(), zmq::radio_session_t::push_msg(), zmq::req_session_t::push_msg(), zmq::dish_session_t::push_msg(), zmq::stream_engine_t::push_msg_to_session(), zmq::stream_engine_t::push_one_then_decode_and_push(), zmq::stream_engine_t::write_credential(), and zmq::stream_engine_t::write_subscription_msg().


      
  | 
  virtual | 
Implements zmq::i_pipe_events.
Definition at line 271 of file session_base.cpp.
References zmq::pipe_t::check_read(), engine, likely, pipe, zmq::i_engine::restart_output(), terminating_pipes, unlikely, zmq::i_engine::zap_msg_available(), zap_pipe, and zmq_assert.

Definition at line 168 of file session_base.cpp.
References ENOTCONN, zmq::pipe_t::read(), and zap_pipe.
Referenced by zmq::null_mechanism_t::receive_and_process_zap_reply(), and zmq::plain_server_t::receive_and_process_zap_reply().


      
  | 
  private | 
Definition at line 499 of file session_base.cpp.
References addr, zmq::pipe_t::hiccup(), zmq::options_t::immediate, zmq::own_t::options, pipe, zmq::address_t::protocol, zmq::options_t::reconnect_ivl, reset(), start_connecting(), zmq::pipe_t::terminate(), terminating_pipes, zmq::options_t::type, ZMQ_SUB, and ZMQ_XSUB.
Referenced by engine_error().


      
  | 
  virtual | 
Reimplemented in zmq::dish_session_t, zmq::req_session_t, and zmq::radio_session_t.
Definition at line 201 of file session_base.cpp.
Referenced by reconnect(), zmq::radio_session_t::reset(), zmq::req_session_t::reset(), and zmq::dish_session_t::reset().

      
  | 
  private | 
Definition at line 524 of file session_base.cpp.
References active, addr, zmq::address_t::address, zmq::options_t::affinity, alloc_assert, zmq::object_t::choose_io_thread(), engine, errno_assert, zmq::udp_engine_t::init(), io_thread, zmq::own_t::launch_child(), zmq::own_t::options, zmq::address_t::protocol, zmq::object_t::send_attach(), zmq::options_t::socks_proxy_address, zmq::options_t::type, zmq_assert, ZMQ_DISH, ZMQ_PUB, ZMQ_RADIO, ZMQ_SUB, ZMQ_XPUB, and ZMQ_XSUB.
Referenced by process_plug(), and reconnect().


      
  | 
  privatevirtual | 
Reimplemented from zmq::io_object_t.
Definition at line 487 of file session_base.cpp.
References has_linger_timer, linger_timer_id, pipe, zmq::pipe_t::terminate(), and zmq_assert.

      
  | 
  virtual | 
Implements zmq::i_pipe_events.
Definition at line 290 of file session_base.cpp.
References engine, pipe, zmq::i_engine::restart_input(), terminating_pipes, and zmq_assert.

Definition at line 183 of file session_base.cpp.
References ENOTCONN, errno_assert, zmq::msg_t::flags, zmq::pipe_t::flush(), zmq::msg_t::init(), zmq::msg_t::more, zmq::pipe_t::write(), zap_pipe, and zmq_assert.
Referenced by zmq::null_mechanism_t::send_zap_request(), and zmq::plain_server_t::send_zap_request().


| int zmq::session_base_t::zap_connect | ( | ) | 
Definition at line 320 of file session_base.cpp.
References ECONNREFUSED, errno_assert, zmq::object_t::find_endpoint(), zmq::pipe_t::flush(), zmq::msg_t::identity, zmq::endpoint_t::options, zmq::pipepair(), zmq::options_t::recv_identity, zmq::object_t::send_bind(), zmq::pipe_t::set_event_sink(), zmq::pipe_t::set_nodelay(), zmq::endpoint_t::socket, zmq::options_t::type, zmq::pipe_t::write(), zap_pipe, zmq_assert, ZMQ_REP, ZMQ_ROUTER, and ZMQ_SERVER.
Referenced by zmq::null_mechanism_t::null_mechanism_t(), and zmq::plain_server_t::process_hello().


| bool zmq::session_base_t::zap_enabled | ( | ) | 
Definition at line 366 of file session_base.cpp.
References zmq::options_t::mechanism, zmq::own_t::options, zmq::options_t::zap_domain, and ZMQ_NULL.
Referenced by zmq::stream_engine_t::handshake().

      
  | 
  private | 
Definition at line 128 of file session_base.hpp.
Referenced by engine_error(), process_plug(), and start_connecting().
      
  | 
  private | 
Definition at line 164 of file session_base.hpp.
Referenced by reconnect(), start_connecting(), and ~session_base_t().
      
  | 
  private | 
Definition at line 148 of file session_base.hpp.
Referenced by engine_error(), pipe_terminated(), process_attach(), process_term(), read_activated(), start_connecting(), write_activated(), and ~session_base_t().
      
  | 
  private | 
Definition at line 161 of file session_base.hpp.
Referenced by pipe_terminated(), process_term(), timer_event(), and ~session_base_t().
      
  | 
  private | 
Definition at line 141 of file session_base.hpp.
Referenced by clean_pipes(), and pull_msg().
      
  | 
  private | 
Definition at line 155 of file session_base.hpp.
Referenced by process_attach(), and start_connecting().
      
  | 
  private | 
Definition at line 145 of file session_base.hpp.
Referenced by pipe_terminated(), and process_term().
      
  | 
  private | 
Definition at line 131 of file session_base.hpp.
Referenced by attach_pipe(), clean_pipes(), engine_error(), flush(), pipe_terminated(), process_attach(), process_term(), pull_msg(), push_msg(), read_activated(), reconnect(), timer_event(), write_activated(), and ~session_base_t().
      
  | 
  private | 
Definition at line 151 of file session_base.hpp.
Referenced by get_socket(), and process_attach().
      
  | 
  private | 
Definition at line 137 of file session_base.hpp.
Referenced by pipe_terminated(), process_term(), read_activated(), reconnect(), and write_activated().
      
  | 
  private | 
Definition at line 134 of file session_base.hpp.
Referenced by engine_error(), pipe_terminated(), process_term(), read_activated(), read_zap_msg(), write_zap_msg(), zap_connect(), and ~session_base_t().