java-coap icon indicating copy to clipboard operation
java-coap copied to clipboard

Question about cancelling observe with `coap+tcp` ?

Open sbernard31 opened this issue 2 years ago • 0 comments

Observe relation cancelling is defined at rfc7641§3.6. Cancellation. I will use :

  • Passive Cancel wording when a client send an RST message to a notification.
  • Active Cancel wording when a client send a request with observe option set to 1.

Reading rfc8323§7.4. Cancellation, I understand that Passive Cancel is not possible with coap+tcp.

When you are using java-coap for coap, you can do Passive Cancel just by removing "observation" from ObservationsStore which is fine. When you do that with coap+tcp, notifications received are just ignore by the client. Concretely you get a log at client side which looks like :

2023-10-27 17:06:09,455 CoapTcpDispatcher [WARN] Can not process CoAP message [127.0.0.1:56090 205 MID:0 Token:0x349ddba051b8041d ContTp:0 obs:6 pl:'IN2dR8X4'] If client doesn't do an Active Cancel, server will continue to send notifications.

The behavior totally makes sense regarding RFCs but from a user point of view I ask my self if this could make sense to automatically send an Active Cancel when we get unwanted notification with "coap+tcp" ? :thinking:

(I will be unavailable next few days. I'll be back on Thursday November 2nd.)

sbernard31 avatar Oct 27 '23 15:10 sbernard31