Skip to content

Instantly share code, notes, and snippets.

@vjrantal
Last active January 26, 2017 16:56
Show Gist options
  • Save vjrantal/59c7edec8bdf5dbe6e67ecfc8de427ea to your computer and use it in GitHub Desktop.
Save vjrantal/59c7edec8bdf5dbe6e67ecfc8de427ea to your computer and use it in GitHub Desktop.
diff --git a/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt.c b/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt.c
index 15e492d..3f51860 100644
--- a/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt.c
+++ b/iothub_client/samples/iothub_client_sample_mqtt/iothub_client_sample_mqtt.c
@@ -24,7 +24,7 @@ static int callbackCounter;
static char msgText[1024];
static char propText[1024];
static bool g_continueRunning;
-#define MESSAGE_COUNT 5
+#define MESSAGE_COUNT 200
#define DOWORK_LOOP_NUM 3
@@ -166,7 +166,7 @@ void iothub_client_sample_mqtt_run(void)
}
}
IoTHubClient_LL_DoWork(iotHubClientHandle);
- ThreadAPI_Sleep(1);
+ ThreadAPI_Sleep(1000);
iterator++;
} while (g_continueRunning);
@@ -176,7 +176,7 @@ void iothub_client_sample_mqtt_run(void)
for (index = 0; index < DOWORK_LOOP_NUM; index++)
{
IoTHubClient_LL_DoWork(iotHubClientHandle);
- ThreadAPI_Sleep(1);
+ ThreadAPI_Sleep(1000);
}
}
IoTHubClient_LL_Destroy(iotHubClientHandle);
diff --git a/iothub_client/src/iothubtransport_mqtt_common.c b/iothub_client/src/iothubtransport_mqtt_common.c
index f0afb34..9f5dbdb 100644
--- a/iothub_client/src/iothubtransport_mqtt_common.c
+++ b/iothub_client/src/iothubtransport_mqtt_common.c
@@ -31,7 +31,7 @@
#include <limits.h>
#include <inttypes.h>
-#define SAS_TOKEN_DEFAULT_LIFETIME 3600
+#define SAS_TOKEN_DEFAULT_LIFETIME 5
#define SAS_REFRESH_MULTIPLIER .8
#define EPOCH_TIME_T_VALUE 0
#define DEFAULT_MQTT_KEEPALIVE 4*60 // 4 min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment