acl
3.5.3.0
|
#include <mqtt_aclient.hpp>
Public 成员函数 | |
mqtt_aclient (aio_handle &handle, sslbase_conf *ssl_conf=NULL) | |
virtual void | destroy (void)=0 |
sslbase_conf * | get_ssl_conf (void) const |
bool | open (const char *addr, int conn_timeout, int rw_timeout) |
bool | open (aio_socket_stream *conn) |
void | close (void) |
aio_socket_stream * | get_conn (void) const |
void | set_host (const char *host) |
bool | send (mqtt_message &message) |
bool | get_ns_addr (string &out) const |
bool | get_server_addr (string &out) const |
Public 成员函数 继承自 acl::aio_open_callback | |
aio_open_callback (void) | |
virtual | ~aio_open_callback (void) |
Public 成员函数 继承自 acl::aio_callback | |
aio_callback (void) | |
virtual | ~aio_callback (void) |
virtual bool | write_callback (void) |
virtual bool | write_wakeup (void) |
Protected 成员函数 | |
virtual | ~mqtt_aclient (void) |
bool | open_callback (void) |
bool | timeout_callback (void) |
void | close_callback (void) |
bool | read_wakeup (void) |
bool | read_callback (char *data, int len) |
bool | message_await (void) |
virtual void | on_ns_failed (void) |
virtual void | on_connect_timeout (void) |
virtual void | on_connect_failed (void) |
virtual bool | on_read_timeout (void) |
virtual void | on_disconnect (void) |
virtual bool | on_open (void)=0 |
virtual bool | on_header (const mqtt_header &) |
virtual bool | on_body (const mqtt_message &)=0 |
Protected 成员函数 继承自 acl::acl::noncopyable | |
noncopyable () | |
~noncopyable () | |
mqtt communication class in aio mode, used by mqtt client or mqtt server.
在文件 mqtt_aclient.hpp 第 15 行定义.
acl::mqtt_aclient::mqtt_aclient | ( | aio_handle & | handle, |
sslbase_conf * | ssl_conf = NULL |
||
) |
constructor
handle | {aio_handle&} |
ssl_conf | {sslbase_conf*} if not NULL, ssl will be used |
|
protectedvirtual |
void acl::mqtt_aclient::close | ( | void | ) |
close the connection with the mqtt server async
|
protectedvirtual |
重载 acl::aio_callback .
|
pure virtual |
because the subclass object was created dynamically, the method will be called when the subclass object is to be freed.
|
inline |
get the connection with the mqtt server
在文件 mqtt_aclient.hpp 第 67 行定义.
bool acl::mqtt_aclient::get_ns_addr | ( | string & | out | ) | const |
get the current dns addr when connection one mqtt server
out | {string&} store the result. |
bool acl::mqtt_aclient::get_server_addr | ( | string & | out | ) | const |
get the mqtt server addr after resolving the domain's address.
out | {string&} store the result. |
|
inline |
get the ssl conf object passed in constructor.
在文件 mqtt_aclient.hpp 第 34 行定义.
|
protected |
|
protectedpure virtual |
|
inlineprotectedvirtual |
在文件 mqtt_aclient.hpp 第 132 行定义.
|
inlineprotectedvirtual |
在文件 mqtt_aclient.hpp 第 129 行定义.
|
inlineprotectedvirtual |
在文件 mqtt_aclient.hpp 第 138 行定义.
|
inlineprotectedvirtual |
在文件 mqtt_aclient.hpp 第 144 行定义.
|
inlineprotectedvirtual |
在文件 mqtt_aclient.hpp 第 126 行定义.
|
protectedpure virtual |
|
inlineprotectedvirtual |
在文件 mqtt_aclient.hpp 第 135 行定义.
bool acl::mqtt_aclient::open | ( | const char * | addr, |
int | conn_timeout, | ||
int | rw_timeout | ||
) |
connect the remote mqtt server, when connected with the server, the callback on_connect() will be called
addr | {const char*} the mqtt server's addr with the format ip|port, or domain|port |
conn_timeout | {int} the timeout for connecting to the server |
rw_timeout | {int} the timeout read/write with the server |
bool acl::mqtt_aclient::open | ( | aio_socket_stream * | conn | ) |
called when connect or accept one connection
conn | {aio_socket_stream*} |
|
inlineprotectedvirtual |
|
protectedvirtual |
重载 acl::aio_callback .
|
protectedvirtual |
重载 acl::aio_callback .
bool acl::mqtt_aclient::send | ( | mqtt_message & | message | ) |
send one mqtt message to one mqtt peer.
message | {mqtt_message&} |
void acl::mqtt_aclient::set_host | ( | const char * | host | ) |
set the remote host name to specify the SSL SNI for SSL handshake, used to connect one mqtt server as a connection client.
host | {const char*} the host name |
|
protectedvirtual |
重载 acl::aio_callback .