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

#include <plain_client.hpp>

Inheritance diagram for zmq::plain_client_t:
Collaboration diagram for zmq::plain_client_t:

Public Member Functions

 plain_client_t (const options_t &options_)
 
virtual ~plain_client_t ()
 
virtual int next_handshake_command (msg_t *msg_)
 
virtual int process_handshake_command (msg_t *msg_)
 
virtual status_t status () const
 
- Public Member Functions inherited from zmq::mechanism_t
 mechanism_t (const options_t &options_)
 
virtual ~mechanism_t ()
 
virtual int decode (msg_t *)
 
virtual int encode (msg_t *)
 
blob_t get_user_id () const
 
const metadata_t::dict_tget_zap_properties ()
 
const metadata_t::dict_tget_zmtp_properties ()
 
void peer_identity (msg_t *msg_)
 
void set_peer_identity (const void *id_ptr, size_t id_size)
 
void set_user_id (const void *user_id, size_t size)
 
virtual int zap_msg_available ()
 

Private Types

enum  state_t {
  sending_hello, waiting_for_welcome, sending_initiate, waiting_for_ready,
  error_command_received, ready
}
 

Private Member Functions

int process_error (const unsigned char *cmd_data, size_t data_size)
 
int process_ready (const unsigned char *cmd_data, size_t data_size)
 
int process_welcome (const unsigned char *cmd_data, size_t data_size)
 
int produce_hello (msg_t *msg_) const
 
int produce_initiate (msg_t *msg_) const
 

Private Attributes

state_t state
 

Additional Inherited Members

- Public Types inherited from zmq::mechanism_t
enum  status_t { handshaking, ready, error }
 
- Protected Member Functions inherited from zmq::mechanism_t
size_t add_property (unsigned char *ptr, const char *name, const void *value, size_t value_len) const
 
int parse_metadata (const unsigned char *ptr_, size_t length, bool zap_flag=false)
 
virtual int property (const std::string &name_, const void *value_, size_t length_)
 
const char * socket_type_string (int socket_type) const
 
- Protected Attributes inherited from zmq::mechanism_t
options_t options
 
metadata_t::dict_t zap_properties
 
metadata_t::dict_t zmtp_properties
 

Detailed Description

Definition at line 41 of file plain_client.hpp.

Member Enumeration Documentation

Enumerator
sending_hello 
waiting_for_welcome 
sending_initiate 
waiting_for_ready 
error_command_received 
ready 

Definition at line 55 of file plain_client.hpp.

Constructor & Destructor Documentation

zmq::plain_client_t::plain_client_t ( const options_t options_)

Definition at line 43 of file plain_client.cpp.

zmq::plain_client_t::~plain_client_t ( )
virtual

Definition at line 49 of file plain_client.cpp.

Member Function Documentation

int zmq::plain_client_t::next_handshake_command ( msg_t msg_)
virtual

Implements zmq::mechanism_t.

Definition at line 53 of file plain_client.cpp.

References produce_hello(), produce_initiate(), sending_hello, sending_initiate, state, waiting_for_ready, and waiting_for_welcome.

Here is the call graph for this function:

int zmq::plain_client_t::process_error ( const unsigned char *  cmd_data,
size_t  data_size 
)
private

Definition at line 208 of file plain_client.cpp.

References EPROTO, error_command_received, state, waiting_for_ready, and waiting_for_welcome.

Referenced by process_handshake_command().

Here is the caller graph for this function:

int zmq::plain_client_t::process_handshake_command ( msg_t msg_)
virtual

Implements zmq::mechanism_t.

Definition at line 75 of file plain_client.cpp.

References zmq::msg_t::close(), zmq::msg_t::data, EPROTO, errno_assert, zmq::msg_t::init(), process_error(), process_ready(), process_welcome(), and zmq::msg_t::size.

Here is the call graph for this function:

int zmq::plain_client_t::process_ready ( const unsigned char *  cmd_data,
size_t  data_size 
)
private

Definition at line 195 of file plain_client.cpp.

References EPROTO, zmq::mechanism_t::parse_metadata(), ready, state, and waiting_for_ready.

Referenced by process_handshake_command().

Here is the call graph for this function:

Here is the caller graph for this function:

int zmq::plain_client_t::process_welcome ( const unsigned char *  cmd_data,
size_t  data_size 
)
private

Definition at line 147 of file plain_client.cpp.

References EPROTO, LIBZMQ_UNUSED, sending_initiate, state, and waiting_for_welcome.

Referenced by process_handshake_command().

Here is the caller graph for this function:

int zmq::plain_client_t::produce_hello ( msg_t msg_) const
private

Definition at line 118 of file plain_client.cpp.

References zmq::msg_t::data, errno_assert, zmq::msg_t::init_size(), zmq::mechanism_t::options, zmq::options_t::plain_password, zmq::options_t::plain_username, and zmq_assert.

Referenced by next_handshake_command().

Here is the call graph for this function:

Here is the caller graph for this function:

int zmq::plain_client_t::produce_initiate ( msg_t msg_) const
private
zmq::mechanism_t::status_t zmq::plain_client_t::status ( ) const
virtual

Member Data Documentation

state_t zmq::plain_client_t::state
private