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

Enable inactivity monitor for DTLS/UDP by default

jkralik opened this issue · comments

I'm not using DTLS.

Ah, I think the confusing part is the defaults. The example code and the main README.md produces code that effectively leaks connections? Is this ever desired? In long-running scenarios or under load clients will invariably connect and re-connect (especially IoT's with flaky connection, watchdogs etc.), and this adds up over time.

Seems it's not limited to DTLS:

go-coap/udp/server.go

Lines 58 to 60 in 073d2c2

createInactivityMonitor: func() inactivity.Monitor {
return inactivity.NewNilMonitor()
},

Perhaps the default should be set to something or be clarified in the README?

Originally posted by @JosefWN in #311 (comment)

Used as default for v3. Fill free to reopen it.