From b5f7f828ab277ab403669f99918760d4c868e71e Mon Sep 17 00:00:00 2001 From: Sudarsana Nagineni Date: Thu, 7 Jan 2016 15:07:31 +0200 Subject: [PATCH] OicClient: Remove handle when PRESENCE_TRIGGER_DELETE event is received Signed-off-by: Sudarsana Nagineni --- lib/OicClient.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/OicClient.js b/lib/OicClient.js index 852bb500..4fdb7883 100644 --- a/lib/OicClient.js +++ b/lib/OicClient.js @@ -336,6 +336,13 @@ _.extend( devicePrototype, { delete this._resources[ index ]; } } + if ( this._handles[ deviceId ] ) { + if ( !this._handles[ deviceId ].stale ) { + iotivity.OCCancel( this._handles[ deviceId ], + iotivity.OCQualityOfService.OC_HIGH_QOS, null, 0 ); + } + delete this._handles[ deviceId ]; + } break; default: