In order to ensure that the connection between an OIC Devices, when using CoAP over TCP, OIC Device should send application layer KeepAlive messages.
The reason to support application layer KeepAlive are as follows :
- TCP KeepAlive only guarantees that a connection is alive at the network layer, but not at the application layer.
- Interval of TCP KeepAlive is configurable only using kernel parameters and is OS dependent.
( eg. 2 hours by default in Linux )
Use Fixed Ping resource
- URI: /oic/ping, Type ID: oic.wk.ping, Interfaces: oic.if.rw
- Property: Interval(mandatory)
Fixed Interval Time
- 2, 4, 8, 16, 32, 64
- Start from 2 minutes and increases in multiples of 2 up to 64 minutes.
Please refer the Core Specification Project B documents ( 12.6. CoAP serialization over TCP )