plgd-dev / go-coap

Implementation of CoAP Server & Client in Go
https://coap.technology
Apache License 2.0
446 stars 116 forks source link

Multicast and Unicast server on same port #271

Closed HRogge closed 2 years ago

HRogge commented 2 years ago

Is it possible for a server using this library to receive both unicast and multicast messages on the same UDP port?

jkralik commented 2 years ago

Hi. The multicast messages support only the server and yes you can use the same port. Pls look to example:

HRogge commented 2 years ago

Thank you for the quick answer, it made me notice that I got drawn to the old (v1?) codebase by an example on pkg.go.dev. I will now look at the new codebase...

HRogge commented 2 years ago

Is there also an example for sending a multicast message (udp message, non-confirmable, Option NoResponse-2) instead of a Discovery? Edit: resolved the problem by using WriteMessage() and turning of the blockwise transfer of the coap session. I think I run into a bug: #272

HRogge commented 2 years ago

solved by #291 and some explanations. thank you for merging the code that quickly