Set request timeout to EXCHANGE_LIFETIME of CoAP.
authorSoemin Tjong <stjong@microsoft.com>
Thu, 6 Apr 2017 22:28:59 +0000 (15:28 -0700)
committerGreg Zaverucha <gregz@microsoft.com>
Wed, 12 Apr 2017 19:59:10 +0000 (19:59 +0000)
EXCHANGE_LIFETIME value is 247 seconds.

Change-Id: I95b896e8459200fbd1a02598ea1537c96a8eccef
Signed-off-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18591
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit b024d2ee727fddedc2d6290dfcb5c49433e30523)
Reviewed-on: https://gerrit.iotivity.org/gerrit/18835
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
resource/IPCA/src/app.cpp
resource/IPCA/src/callback.cpp

index 278b4ab..2ea0096 100644 (file)
@@ -116,7 +116,7 @@ void App::AppWorkerThread(App* app)
 
     const uint64_t PingPeriodMS = 30000;  // Do device ping for Observed devices every 30 seconds.
 
-    // Outstanding requests should time out in 2 seconds per rfc 7252.
+    // Outstanding requests should time out in 247 seconds (EXCHANGE_LIFETIME) per rfc 7252.
     // Wake up every second to check.
     const size_t AppThreadSleepTimeSeconds = 1;
     std::chrono::seconds appThreadSleepTime(AppThreadSleepTimeSeconds);
index cf78c3a..e321364 100644 (file)
@@ -392,8 +392,7 @@ void Callback::RemoveCallbackInfo(size_t mapKey)
 
 void Callback::CompleteAndRemoveExpiredCallbackInfo(std::vector<CallbackInfo::Ptr>& cbInfoList)
 {
-    // @tbd: determine a good value for response timeout.
-    const int RequestTimeoutMs = 2000;    // 2 seconds for request timeout.
+    const int RequestTimeoutMs = 247000;    // This is EXCHANGE_LIFETIME defined in RFC7252.
 
     uint64_t currentTime = OICGetCurrentTime(TIME_IN_MS);