fixed interval time in keepalive resource and logic to disconnect after sign up
authorJung Seungho <shonest.jung@samsung.com>
Wed, 10 May 2017 09:24:33 +0000 (18:24 +0900)
committerJee Hyeok Kim <jihyeok13.kim@samsung.com>
Thu, 11 May 2017 07:19:00 +0000 (07:19 +0000)
Change-Id: I4cbf263f6ca2bfdc2614d3678b309aaa32dfe239
Signed-off-by: Jung Seungho <shonest.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19771
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Yeonghun Nam <yeonghun.nam@samsung.com>
Reviewed-by: Jee Hyeok Kim <jihyeok13.kim@samsung.com>
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/DeviceServerSystem.java
cloud/interface/src/main/java/org/iotivity/cloud/ciserver/resources/KeepAliveResource.java

index d55cded..13d5cba 100644 (file)
@@ -341,6 +341,11 @@ public class DeviceServerSystem extends ServerSystem {
 
                 switch (urlPath) {
 
+                    case OICConstants.ACCOUNT_FULL_URI:
+                        ctx.writeAndFlush(msg);
+                        ctx.close();
+                        return;
+
                     case OICConstants.ACCOUNT_SESSION_FULL_URI:
                         HashMap<String, Object> payloadData = mCbor
                                 .parsePayloadFromCbor(response.getPayload(),
index 8e89806..9503358 100644 (file)
@@ -114,8 +114,9 @@ public class KeepAliveResource extends Resource {
 
         checkPayloadException(Constants.REQ_PING, payloadData);
 
-        Long pingTime = Integer.valueOf(
-                payloadData.get(Constants.REQ_PING).toString()) * (long) 60000;
+        Long pingTime = (long) (Integer
+                .valueOf(payloadData.get(Constants.REQ_PING).toString())
+                * (long) 60000 * 1.1);
         Long connectionTime = System.currentTimeMillis() + pingTime;
         mConnectionPool.put(srcDevice, connectionTime);