mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 02:22:54 +03:00
This bugfix allows clients to send datagrams to IP multicast groups. After introducing the concept of client sessions, datagram sockets have been connected to their remote peer in coap_socket_connect_udp(). As this operation fails for multicast addresses, sending to multicast groups was not possible anymore. coap_socket_connect_udp() now checks whether the given server address is a multicast address. If this is the case, connect() is not called and the flag COAP_SOCKET_MULTICAST is set in the coap_socket_t structure while COAP_SOCKET_CONNECTED is cleared. The flag COAP_SOCKET_CONNECTED is now set by coap_socket_connect_udp() and coap_socket_connect_tcp1(). coap_read_session() now allows reading from sockets that have either the flag COAP_SOCKET_CONNECTED or COAP_SOCKET_MULTICAST set.