Skip to content

Commit

Permalink
Implement stop method for mqtt5 client with no args (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfod committed Jan 31, 2024
1 parent 63c9a00 commit 947d0bd
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 82 deletions.
15 changes: 14 additions & 1 deletion src/main/java/software/amazon/awssdk/crt/mqtt5/Mqtt5Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,26 @@ public void start() throws CrtRuntimeException {
*
* This is an asynchronous operation.
*
* @param disconnectPacket (optional) Properties of a DISCONNECT packet to send as part of the shutdown process
* @param disconnectPacket (optional) Properties of a DISCONNECT packet to send as part of the shutdown process. When
* disconnectPacket is null, no DISCONNECT packets will be sent.
* @throws CrtRuntimeException If the native client is unable to initialize the stop process.
*/
public void stop(DisconnectPacket disconnectPacket) throws CrtRuntimeException {
mqtt5ClientInternalStop(getNativeHandle(), disconnectPacket);
}

/**
* Notifies the Mqtt5Client that you want it to end connectivity to the configured endpoint, disconnecting any
* existing connection and halting any reconnect attempts. No DISCONNECT packets will be sent.
*
* This is an asynchronous operation.
*
* @throws CrtRuntimeException If the native client is unable to initialize the stop process.
*/
public void stop() throws CrtRuntimeException {
stop(null);
}

/**
* Tells the Mqtt5Client to attempt to send a PUBLISH packet.
*
Expand Down

0 comments on commit 947d0bd

Please sign in to comment.