open-coap / java-coap

CoAP Java library
Apache License 2.0
18 stars 5 forks source link

Question about cancelling observe with `coap+tcp` ? #71

Open sbernard31 opened 8 months ago

sbernard31 commented 8 months ago

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

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.)