28 class AWS_CRT_CPP_API Mqtt5ClientCore final :
public std::enable_shared_from_this<Mqtt5ClientCore>
30 friend class Mqtt5Client;
31 friend class Mqtt::MqttConnection;
41 static std::shared_ptr<Mqtt5ClientCore> NewMqtt5ClientCore(
42 const Mqtt5ClientOptions &options,
51 std::shared_ptr<Mqtt5ClientCore> getptr() {
return shared_from_this(); }
56 operator bool() const noexcept;
61 int LastError() const noexcept;
72 std::shared_ptr<PublishPacket> publishOptions,
73 OnPublishCompletionHandler onPublishCompletionCallback = NULL) noexcept;
84 std::shared_ptr<SubscribePacket> subscribeOptions,
85 OnSubscribeCompletionHandler onSubscribeCompletionCallback = NULL) noexcept;
96 std::shared_ptr<UnsubscribePacket> unsubscribeOptions,
97 OnUnsubscribeCompletionHandler onUnsubscribeCompletionCallback = NULL) noexcept;
108 void Close() noexcept;
110 virtual ~Mqtt5ClientCore();
112 struct aws_mqtt5_client *GetUnderlyingHandle() const noexcept {
return m_client; }
115 Mqtt5ClientCore(
const Mqtt5ClientOptions &options, Allocator *allocator =
ApiAllocator()) noexcept;
125 std::shared_ptr<Crt::Mqtt::MqttConnection> NewConnection(
126 const Mqtt5::Mqtt5to3AdapterOptions *options) noexcept;
129 static
void s_publishCompletionCallback(
130 enum aws_mqtt5_packet_type packet_type,
135 static
void s_subscribeCompletionCallback(
136 const struct aws_mqtt5_packet_suback_view *puback,
140 static
void s_unsubscribeCompletionCallback(
141 const struct aws_mqtt5_packet_unsuback_view *puback,
145 static
void s_lifeCycleEventCallback(const aws_mqtt5_client_lifecycle_event *event);
147 static
void s_publishReceivedCallback(const aws_mqtt5_packet_publish_view *publish,
void *user_data);
149 static
void s_onWebsocketHandshake(
150 aws_http_message *rawRequest,
152 aws_mqtt5_transform_websocket_handshake_complete_fn *complete_fn,
155 static
void s_clientTerminationCompletion(
void *complete_ctx);
158 OnWebSocketHandshakeIntercept websocketInterceptor;
162 OnConnectionSuccessHandler onConnectionSuccess;
167 OnConnectionFailureHandler onConnectionFailure;
172 OnDisconnectionHandler onDisconnection;
177 OnStoppedHandler onStopped;
182 OnAttemptingConnectHandler onAttemptingConnect;
187 OnPublishReceivedHandler onPublishReceived;
193 std::shared_ptr<Mqtt5ClientCore> m_selfReference;
198 ScopedResource<Mqtt5to3AdapterOptions> m_mqtt5to3AdapterOptions;
212 std::recursive_mutex m_callback_lock;
214 aws_mqtt5_client *m_client;
221 class Mqtt5to3AdapterOptions
223 friend class Mqtt5ClientOptions;
224 friend class Mqtt5ClientCore;
225 friend class Mqtt::MqttConnection;
229 Mqtt5to3AdapterOptions();
236 static ScopedResource<Mqtt5to3AdapterOptions> NewMqtt5to3AdapterOptions(
237 const Mqtt5ClientOptions &options)
noexcept;
240 Mqtt::MqttConnectionOptions m_mqtt3Options;
248 Crt::Mqtt::OnWebSocketHandshakeIntercept m_webSocketInterceptor;
256 Crt::Optional<Crt::Http::HttpClientConnectionProxyOptions> m_proxyOptions;
#define AWS_CRT_CPP_API
Definition Exports.h:36
std::function< void(std::shared_ptr< Http::HttpRequest >, const OnWebSocketHandshakeInterceptComplete &)> OnWebSocketHandshakeIntercept
Definition Mqtt5Client.h:324
aws_allocator Allocator
Definition Allocator.h:14
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition Allocator.cpp:24
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > String
Definition Types.h:45
Definition Allocator.h:11
Definition StringView.h:862