Skip to content

Commit ed802dc

Browse files
authored
Pull in s2n shutdown fix via crt; add resource waits on samples (#148)
* Pull in s2n shutdown fix via crt; add resource waits on samples * Add long operation timeout to support tls shutdown delay for device advisor
1 parent a0ac6f0 commit ed802dc

File tree

9 files changed

+18
-7
lines changed

9 files changed

+18
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ mvn clean install
5050
``` sh
5151
# NOTE: use the latest version of the CRT here
5252

53-
git clone --branch v0.11.3 https://github.com/awslabs/aws-crt-java.git
53+
git clone --branch v0.11.5 https://github.com/awslabs/aws-crt-java.git
5454

5555
git clone https://github.com/awslabs/aws-iot-device-sdk-java-v2.git
5656
cd aws-crt-java
@@ -65,7 +65,7 @@ Supports API 26 or newer.
6565
NOTE: The shadow sample does not currently complete on android due to its dependence on stdin keyboard input.
6666

6767
``` sh
68-
git clone --recursive --branch v0.11.3 https://github.com/awslabs/aws-crt-java.git
68+
git clone --recursive --branch v0.11.5 https://github.com/awslabs/aws-crt-java.git
6969
git clone https://github.com/awslabs/aws-iot-device-sdk-java-v2.git
7070
cd aws-crt-java/android
7171
./gradlew connectedCheck # optional, will run the unit tests on any connected devices/emulators
@@ -86,7 +86,7 @@ repositories {
8686
}
8787
8888
dependencies {
89-
implementation 'software.amazon.awssdk.crt:android:0.11.3'
89+
implementation 'software.amazon.awssdk.crt:android:0.11.5'
9090
}
9191
```
9292

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ repositories {
5050
dependencies {
5151
implementation fileTree(dir: 'libs', include: ['*.jar'])
5252
implementation project(":iotdevicesdk")
53-
implementation 'software.amazon.awssdk.crt:android:0.11.3'
53+
implementation 'software.amazon.awssdk.crt:android:0.11.5'
5454
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
5555
implementation 'androidx.appcompat:appcompat:1.1.0'
5656
implementation 'androidx.core:core:1.2.0'

android/iotdevicesdk/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ repositories {
8787

8888
dependencies {
8989
implementation fileTree(dir: 'libs', include: ['*.jar'])
90-
implementation 'software.amazon.awssdk.crt:android:0.11.3'
90+
implementation 'software.amazon.awssdk.crt:android:0.11.5'
9191
implementation 'com.google.code.gson:gson:2.8.5'
9292
implementation 'androidx.appcompat:appcompat:1.1.0'
9393
testImplementation 'junit:junit:4.12'

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<modules>
1010
<module>sdk</module>
1111
<module>samples/BasicPubSub</module>
12+
<module>samples/Greengrass</module>
1213
<module>samples/Jobs</module>
1314
<module>samples/PubSubStress</module>
1415
<module>samples/RawPubSub</module>

samples/BasicPubSub/src/main/java/pubsub/PubSub.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package pubsub;
77

88
import software.amazon.awssdk.crt.CRT;
9+
import software.amazon.awssdk.crt.CrtResource;
910
import software.amazon.awssdk.crt.CrtRuntimeException;
1011
import software.amazon.awssdk.crt.auth.credentials.X509CredentialsProvider;
1112
import software.amazon.awssdk.crt.http.HttpProxyOptions;
@@ -246,7 +247,9 @@ public void onConnectionResumed(boolean sessionPresent) {
246247
.withConnectionEventCallbacks(callbacks)
247248
.withClientId(clientId)
248249
.withEndpoint(endpoint)
249-
.withCleanSession(true);
250+
.withPort((short)port)
251+
.withCleanSession(true)
252+
.withProtocolOperationTimeoutMs(60000);
250253

251254
if (useWebsockets) {
252255
builder.withWebsockets(true);
@@ -319,6 +322,8 @@ public void onConnectionResumed(boolean sessionPresent) {
319322
System.out.println("Exception encountered: " + ex.toString());
320323
}
321324

325+
CrtResource.waitForNoResources();
326+
322327
System.out.println("Complete!");
323328
}
324329
}

samples/Identity/src/main/java/identity/FleetProvisioningSample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public void onConnectionResumed(boolean sessionPresent) {
264264
System.out.println("Exception encountered: " + ex.toString());
265265
}
266266

267+
CrtResource.waitForNoResources();
267268
System.out.println("Complete!");
268269
}
269270

samples/Jobs/src/main/java/jobs/JobsSample.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package jobs;
77

88
import software.amazon.awssdk.crt.CRT;
9+
import software.amazon.awssdk.crt.CrtResource;
910
import software.amazon.awssdk.crt.CrtRuntimeException;
1011
import software.amazon.awssdk.crt.io.ClientBootstrap;
1112
import software.amazon.awssdk.crt.io.EventLoopGroup;
@@ -356,6 +357,7 @@ public void onConnectionResumed(boolean sessionPresent) {
356357
System.out.println("Exception encountered: " + ex.toString());
357358
}
358359

360+
CrtResource.waitForNoResources();
359361
System.out.println("Complete!");
360362
}
361363
}

samples/RawPubSub/src/main/java/rawpubsub/RawPubSub.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package rawpubsub;
77

88
import software.amazon.awssdk.crt.CRT;
9+
import software.amazon.awssdk.crt.CrtResource;
910
import software.amazon.awssdk.crt.CrtRuntimeException;
1011
import software.amazon.awssdk.crt.io.ClientBootstrap;
1112
import software.amazon.awssdk.crt.io.EventLoopGroup;
@@ -245,6 +246,7 @@ public void onConnectionResumed(boolean sessionPresent) {
245246
System.out.println("Exception encountered: " + ex.toString());
246247
}
247248

249+
CrtResource.waitForNoResources();
248250
System.out.println("Complete!");
249251
}
250252
}

sdk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>software.amazon.awssdk.crt</groupId>
4444
<artifactId>aws-crt</artifactId>
45-
<version>0.11.3</version>
45+
<version>0.11.5</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>junit</groupId>

0 commit comments

Comments
 (0)