shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

fix: remove closed UDP channels from CoapNetworkManagement #66

Closed JKRhb closed 2 years ago

JKRhb commented 2 years ago

Using the library, I noticed that you cannot reuse the same or even a different client for requests to the same endpoint once the first client has been closed. I discovered that this is the case because a closed CoapUDPChannel was not being removed from the static list of networks in the CoapNetworkManagement class, yet. This PR fixes this issue.

Doing so, I noticed that calling exit(0) in some examples is not necessary anymore after the client has been closed. The remaining examples still need the exit(0) call, though.