You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the event that the resource changes in a way that would cause a
normal GET request at that time to return a non-2.xx response (for
example, when the resource is deleted), the server sends a
notification with an appropriate response code (such as 4.04 Not
Found) and removes the client's entry from the list of observers of
the resource. Non-2.xx responses do not include an Observe Option.
I think that currently java-coap doesn't allow this.
Because when I try to send a 4.04 Not Found as notification, it is never sent.
I guess this is because of NotificationValidator, see :
thrownewIllegalArgumentException("Notification packet should have observation header set");
}
if (obs.getToken().isEmpty()) {
thrownewIllegalArgumentException("Notification packet should have non-empty token");
}
returnservice.apply(obs);
}
Not directly linked but that exception was silently ignore in my code (I mean I didn't even see a log), I don't know if there is something to improve in java-coap or in my code for this last point.
The text was updated successfully, but these errors were encountered:
The RFC7641 - Observing Resources in the Constrained Application Protocol (CoAP) § 3.2. Notifications says :
I think that currently java-coap doesn't allow this.
Because when I try to send a 4.04 Not Found as notification, it is never sent.
I guess this is because of
NotificationValidator
, see :java-coap/coap-core/src/main/java/com/mbed/coap/server/NotificationValidator.java
Lines 24 to 35 in a0c8294
Not directly linked but that exception was silently ignore in my code (I mean I didn't even see a log), I don't know if there is something to improve in java-coap or in my code for this last point.
The text was updated successfully, but these errors were encountered: