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;
106 bool InvokePublishAcknowledgement(
107 const PublishAcknowledgementHandle &publishAcknowledgementHandle) noexcept;
118 void Close() noexcept;
122 struct aws_mqtt5_client *GetUnderlyingHandle() const noexcept {
return m_client; }
125 Mqtt5ClientCore(
const Mqtt5ClientOptions &options, Allocator *allocator =
ApiAllocator()) noexcept;
135 std::shared_ptr<Crt::Mqtt::MqttConnection> NewConnection(
136 const Mqtt5::Mqtt5to3AdapterOptions *options) noexcept;
139 static
void s_publishCompletionCallback(
140 enum aws_mqtt5_packet_type packet_type,
145 static
void s_subscribeCompletionCallback(
146 const struct aws_mqtt5_packet_suback_view *puback,
150 static
void s_unsubscribeCompletionCallback(
151 const struct aws_mqtt5_packet_unsuback_view *puback,
155 static
void s_lifeCycleEventCallback(const aws_mqtt5_client_lifecycle_event *event);
157 static
void s_publishReceivedCallback(const aws_mqtt5_packet_publish_view *publish,
void *user_data);
159 static
void s_onWebsocketHandshake(
160 aws_http_message *rawRequest,
162 aws_mqtt5_transform_websocket_handshake_complete_fn *complete_fn,
165 static
void s_clientTerminationCompletion(
void *complete_ctx);
168 OnWebSocketHandshakeIntercept websocketInterceptor;
172 OnConnectionSuccessHandler onConnectionSuccess;
177 OnConnectionFailureHandler onConnectionFailure;
182 OnDisconnectionHandler onDisconnection;
187 OnStoppedHandler onStopped;
192 OnAttemptingConnectHandler onAttemptingConnect;
197 OnPublishReceivedHandler onPublishReceived;
203 std::shared_ptr<Mqtt5ClientCore> m_selfReference;
208 ScopedResource<Mqtt5to3AdapterOptions> m_mqtt5to3AdapterOptions;
222 std::recursive_mutex m_callback_lock;
224 aws_mqtt5_client *m_client;
231 class Mqtt5to3AdapterOptions
233 friend class Mqtt5ClientOptions;
234 friend class Mqtt5ClientCore;
235 friend class Mqtt::MqttConnection;
239 Mqtt5to3AdapterOptions();
246 static ScopedResource<Mqtt5to3AdapterOptions> NewMqtt5to3AdapterOptions(
247 const Mqtt5ClientOptions &options)
noexcept;
250 Mqtt::MqttConnectionOptions m_mqtt3Options;
258 Crt::Mqtt::OnWebSocketHandshakeIntercept m_webSocketInterceptor;
266 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:353
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