libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
zmq::ipc_connecter_t Class Reference

#include <ipc_connecter.hpp>

Inheritance diagram for zmq::ipc_connecter_t:
Collaboration diagram for zmq::ipc_connecter_t:

Public Member Functions

 ipc_connecter_t (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_)
 
 ~ipc_connecter_t ()
 
- 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_tget_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 ()
 

Private Types

enum  { reconnect_timer_id = 1 }
 

Private Member Functions

 ipc_connecter_t (const ipc_connecter_t &)
 
void add_reconnect_timer ()
 
int close ()
 
fd_t connect ()
 
int get_new_reconnect_ivl ()
 
void in_event ()
 
int open ()
 
const ipc_connecter_toperator= (const ipc_connecter_t &)
 
void out_event ()
 
void process_plug ()
 
void process_term (int linger_)
 
void start_connecting ()
 
void timer_event (int id_)
 

Private Attributes

const address_taddr
 
int current_reconnect_ivl
 
const bool delayed_start
 
std::string endpoint
 
handle_t handle
 
bool handle_valid
 
fd_t s
 
zmq::session_base_tsession
 
zmq::socket_base_tsocket
 
bool timer_started
 

Additional Inherited Members

- Protected Types inherited from zmq::io_object_t
typedef poller_t::handle_t handle_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 process_term (int linger_)
 
void term_child (own_t *object_)
 
void terminate ()
 
- Protected Member Functions inherited from zmq::object_t
zmq::io_thread_tchoose_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_attach (zmq::i_engine *engine_)
 
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 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_)
 
- Protected Attributes inherited from zmq::own_t
options_t options
 

Detailed Description

Definition at line 49 of file ipc_connecter.hpp.

Member Enumeration Documentation

anonymous enum
private
Enumerator
reconnect_timer_id 

Definition at line 63 of file ipc_connecter.hpp.

Constructor & Destructor Documentation

zmq::ipc_connecter_t::ipc_connecter_t ( zmq::io_thread_t io_thread_,
zmq::session_base_t session_,
const options_t options_,
const address_t addr_,
bool  delayed_start_ 
)

Definition at line 53 of file ipc_connecter.cpp.

References addr, endpoint, zmq::address_t::protocol, session, socket, zmq::address_t::to_string(), and zmq_assert.

Here is the call graph for this function:

zmq::ipc_connecter_t::~ipc_connecter_t ( )

Definition at line 72 of file ipc_connecter.cpp.

References handle_valid, zmq::retired_fd, s, timer_started, and zmq_assert.

zmq::ipc_connecter_t::ipc_connecter_t ( const ipc_connecter_t )
private

Member Function Documentation

void zmq::ipc_connecter_t::add_reconnect_timer ( )
private

Definition at line 175 of file ipc_connecter.cpp.

References zmq::io_object_t::add_timer(), endpoint, zmq::socket_base_t::event_connect_retried(), get_new_reconnect_ivl(), reconnect_timer_id, socket, and timer_started.

Referenced by out_event(), process_plug(), and start_connecting().

Here is the call graph for this function:

Here is the caller graph for this function:

int zmq::ipc_connecter_t::close ( )
private

Definition at line 235 of file ipc_connecter.cpp.

References endpoint, errno_assert, zmq::socket_base_t::event_closed(), zmq::retired_fd, s, socket, and zmq_assert.

Referenced by out_event(), process_term(), and start_connecting().

Here is the call graph for this function:

Here is the caller graph for this function:

zmq::fd_t zmq::ipc_connecter_t::connect ( )
private

Definition at line 245 of file ipc_connecter.cpp.

References ECONNREFUSED, ECONNRESET, EHOSTUNREACH, ENETDOWN, ENETUNREACH, errno_assert, ETIMEDOUT, zmq::retired_fd, and s.

Referenced by open(), and out_event().

Here is the caller graph for this function:

int zmq::ipc_connecter_t::get_new_reconnect_ivl ( )
private

Definition at line 183 of file ipc_connecter.cpp.

References current_reconnect_ivl, zmq::generate_random(), zmq::own_t::options, zmq::options_t::reconnect_ivl, and zmq::options_t::reconnect_ivl_max.

Referenced by add_reconnect_timer().

Here is the call graph for this function:

Here is the caller graph for this function:

void zmq::ipc_connecter_t::in_event ( )
privatevirtual

Reimplemented from zmq::io_object_t.

Definition at line 105 of file ipc_connecter.cpp.

References out_event().

Here is the call graph for this function:

int zmq::ipc_connecter_t::open ( )
private

Definition at line 203 of file ipc_connecter.cpp.

References zmq::ipc_address_t::addr(), addr, zmq::ipc_address_t::addrlen(), connect(), EINPROGRESS, zmq::address_t::ipc_addr, zmq::open_socket(), zmq::address_t::resolved, zmq::retired_fd, s, zmq::unblock_socket(), and zmq_assert.

Referenced by start_connecting().

Here is the call graph for this function:

Here is the caller graph for this function:

const ipc_connecter_t& zmq::ipc_connecter_t::operator= ( const ipc_connecter_t )
private
void zmq::ipc_connecter_t::out_event ( )
privatevirtual

Reimplemented from zmq::io_object_t.

Definition at line 113 of file ipc_connecter.cpp.

References add_reconnect_timer(), alloc_assert, close(), connect(), endpoint, zmq::socket_base_t::event_connected(), handle, handle_valid, zmq::own_t::options, zmq::retired_fd, zmq::io_object_t::rm_fd(), zmq::object_t::send_attach(), session, socket, and zmq::own_t::terminate().

Referenced by in_event(), and start_connecting().

Here is the call graph for this function:

Here is the caller graph for this function:

void zmq::ipc_connecter_t::process_plug ( )
privatevirtual

Reimplemented from zmq::object_t.

Definition at line 79 of file ipc_connecter.cpp.

References add_reconnect_timer(), delayed_start, and start_connecting().

Here is the call graph for this function:

void zmq::ipc_connecter_t::process_term ( int  linger_)
privatevirtual

Reimplemented from zmq::object_t.

Definition at line 87 of file ipc_connecter.cpp.

References zmq::io_object_t::cancel_timer(), close(), handle, handle_valid, zmq::own_t::process_term(), reconnect_timer_id, zmq::retired_fd, zmq::io_object_t::rm_fd(), s, and timer_started.

Here is the call graph for this function:

void zmq::ipc_connecter_t::start_connecting ( )
private

Definition at line 146 of file ipc_connecter.cpp.

References zmq::io_object_t::add_fd(), add_reconnect_timer(), close(), EINPROGRESS, endpoint, zmq::socket_base_t::event_connect_delayed(), handle, handle_valid, open(), out_event(), zmq::retired_fd, s, zmq::io_object_t::set_pollout(), socket, and zmq_errno().

Referenced by process_plug(), and timer_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void zmq::ipc_connecter_t::timer_event ( int  id_)
privatevirtual

Reimplemented from zmq::io_object_t.

Definition at line 139 of file ipc_connecter.cpp.

References reconnect_timer_id, start_connecting(), timer_started, and zmq_assert.

Here is the call graph for this function:

Member Data Documentation

const address_t* zmq::ipc_connecter_t::addr
private

Definition at line 98 of file ipc_connecter.hpp.

Referenced by ipc_connecter_t(), and open().

int zmq::ipc_connecter_t::current_reconnect_ivl
private

Definition at line 120 of file ipc_connecter.hpp.

Referenced by get_new_reconnect_ivl().

const bool zmq::ipc_connecter_t::delayed_start
private

Definition at line 111 of file ipc_connecter.hpp.

Referenced by process_plug().

std::string zmq::ipc_connecter_t::endpoint
private
handle_t zmq::ipc_connecter_t::handle
private

Definition at line 104 of file ipc_connecter.hpp.

Referenced by out_event(), process_term(), and start_connecting().

bool zmq::ipc_connecter_t::handle_valid
private

Definition at line 108 of file ipc_connecter.hpp.

Referenced by out_event(), process_term(), start_connecting(), and ~ipc_connecter_t().

fd_t zmq::ipc_connecter_t::s
private
zmq::session_base_t* zmq::ipc_connecter_t::session
private

Definition at line 117 of file ipc_connecter.hpp.

Referenced by ipc_connecter_t(), and out_event().

zmq::socket_base_t* zmq::ipc_connecter_t::socket
private
bool zmq::ipc_connecter_t::timer_started
private