plgd-dev / go-coap

Implementation of CoAP Server & Client in Go

Home Page:https://coap.technology

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server response with ACK to Empty CON (CoAP Ping)

niondir opened this issue · comments

Due to rfc7252:

the four message types can be used as in Table 1. "*" means that the combination is not used in normal operation but only to elicit a Reset message ("CoAP ping").

In clientconn.go I can observe that also an ACK is accepted as Ping response:

if r.Type() == message.Reset || r.Type() == message.Acknowledgement {

We did observe, that the server indeed sends back an ACK and not a Reset message when sending a CoAP Ping.

@niondir
I'm actually using this "bug" to keep my observe connection alive with clients.

Client sends empty CON, server responds with ACK every couple minutes.

Is there a better way if this is intended to send a reset?