I implement DTLS protocol for CoAP on C, C++. As I see I can use OpenSSL or WolfSSL. For example WolfSSL:
https://github.com/wolfSSL/wolfssl-examples/blob/master/dtls/client-dtls-nonblocking.c
But how I can detect that some message has been sent to me?