wolfSSL / wolfssl-examples

Example applications using the wolfSSL lightweight SSL/TLS library
https://www.wolfssl.com
255 stars 177 forks source link

server-dtls13-event.c example not work on windows #447

Open FutureKosmos opened 4 months ago

FutureKosmos commented 4 months ago

For this example, I'm actually quite confused as to why UDP is being emulated to behave like TCP. And for scenarios that support multiple clients, aside from having the DTLS server recreate a socket when it receives client data and then bind it to the same address as the listening socket, are there no other methods? Because doing this is not supported by every operating system.

ejohnstown commented 4 months ago

For our example and demonstration code, we found it easiest to do it that way so we didn't have to deal with it at the application level. It is a demonstration for setting up the DTLS connection, not for UDP networking. For that, the server would need to have some kind of map linking an IP address quad to the WOLFSSL object for the DTLS session.

Portability is always an issue. And code that works for both Windows and Linux might not work with some embedded RTOS or network stack as well.