forked from zeromq/libzmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplain_client.hpp
46 lines (36 loc) · 1.06 KB
/
plain_client.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_PLAIN_CLIENT_HPP_INCLUDED__
#define __ZMQ_PLAIN_CLIENT_HPP_INCLUDED__
#include "mechanism_base.hpp"
#include "options.hpp"
namespace zmq
{
class msg_t;
class plain_client_t ZMQ_FINAL : public mechanism_base_t
{
public:
plain_client_t (session_base_t *session_, const options_t &options_);
~plain_client_t ();
// mechanism implementation
int next_handshake_command (msg_t *msg_);
int process_handshake_command (msg_t *msg_);
status_t status () const;
private:
enum state_t
{
sending_hello,
waiting_for_welcome,
sending_initiate,
waiting_for_ready,
error_command_received,
ready
};
state_t _state;
void produce_hello (msg_t *msg_) const;
void produce_initiate (msg_t *msg_) const;
int process_welcome (const unsigned char *cmd_data_, size_t data_size_);
int process_ready (const unsigned char *cmd_data_, size_t data_size_);
int process_error (const unsigned char *cmd_data_, size_t data_size_);
};
}
#endif