eclipse-californium / californium.tools

Californium project
Other
59 stars 57 forks source link

Fix Observe support for CoAP command-line client #80

Closed jasta closed 2 years ago

jasta commented 2 years ago

When using the cf-client tool, specifying --extended-method OBSERVE would always result in a stall after the first response due to a missing NotificationListener that is normally established through the canonical use of CoapClient.observe(...). The command-line client, however, manually interacts with request and request.send() which lacked this glue. This change simply adds that glue manually back in rather than switching to the canonical approach.

Tested against libcoap's coap-server as with:

$ coap-server -v 9 &
$ java -jar run/cf-client-3.6.0-SNAPSHOT.jar --extended-method OBSERVE coap://localhost/time
boaks commented 2 years ago

Good catch an nice fix! Thanks a lot!

boaks commented 2 years ago

LGTM

boaks commented 2 years ago

Would it be possible, that you squash your commits into one? squash and force push on your branch?

jasta commented 2 years ago

Sure no problem, I'll squash them today