Skip to content

Commit

Permalink
Expose socket options from Mqtt5ClientBuilder (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera authored Aug 26, 2024
1 parent dca3cd9 commit 116bb95
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/aws/iot/Mqtt5Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,15 @@ namespace Aws
*/
Mqtt5ClientBuilder &WithCertificateAuthority(const Crt::ByteCursor &cert) noexcept;

/**
* Overrides the socket properties of the underlying MQTT connections made by the client. Leave undefined
* to use defaults (no TCP keep alive, 10 second socket timeout).
*
* @param socketOptions - The socket properties of the underlying MQTT connections made by the client
* @return - The Mqtt5ClientBuilder
*/
Mqtt5ClientBuilder &WithSocketOptions(Crt::Io::SocketOptions socketOptions) noexcept;

/**
* Sets http proxy options.
*
Expand Down
6 changes: 6 additions & 0 deletions source/iot/Mqtt5Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ namespace Aws
return *this;
}

Mqtt5ClientBuilder &Mqtt5ClientBuilder::WithSocketOptions(Crt::Io::SocketOptions socketOptions) noexcept
{
m_options->WithSocketOptions(std::move(socketOptions));
return *this;
}

Mqtt5ClientBuilder &Mqtt5ClientBuilder::WithHttpProxyOptions(
const Crt::Http::HttpClientConnectionProxyOptions &proxyOptions) noexcept
{
Expand Down

0 comments on commit 116bb95

Please sign in to comment.