static CAGetDTLSPskCredentialsHandler g_getCredentialsCallback = NULL;
/**
- * @var MAX_RETRANSMISSION_TIME
+ * @var RETRANSMISSION_TIME
* @brief Maximum timeout value (in seconds) to start DTLS retransmission.
*/
-#define MAX_RETRANSMISSION_TIME 1
+#define RETRANSMISSION_TIME 1
/**
* @var g_dtlsHandshakeCallback
static void CAStartRetransmit()
{
static int timerId = -1;
- clock_time_t nextSchedule = MAX_RETRANSMISSION_TIME;
-
- OIC_LOG(DEBUG, NET_DTLS_TAG, "CAStartRetransmit IN");
-
if (timerId != -1)
{
//clear previous timer
ca_mutex_unlock(g_dtlsContextMutex);
return;
}
-
- OIC_LOG(DEBUG, NET_DTLS_TAG, "Check retransmission");
- dtls_check_retransmit(g_caDtlsContext->dtlsContext, &nextSchedule);
+ dtls_check_retransmit(g_caDtlsContext->dtlsContext, NULL);
ca_mutex_unlock(g_dtlsContextMutex);
-
- //re-transmission timeout should not be greater then max one
- //this will cover case when several clients start dtls sessions
- nextSchedule /= CLOCKS_PER_SEC;
- if (nextSchedule > MAX_RETRANSMISSION_TIME)
- {
- nextSchedule = MAX_RETRANSMISSION_TIME;
- }
}
-
//start new timer
- OIC_LOG(DEBUG, NET_DTLS_TAG, "Start new timer");
- registerTimer(nextSchedule, &timerId, CAStartRetransmit);
-
- OIC_LOG(DEBUG, NET_DTLS_TAG, "CAStartRetransmit OUT");
+ registerTimer(RETRANSMISSION_TIME, &timerId, CAStartRetransmit);
}
CAResult_t CAAdapterNetDtlsInit()