Il 25/06/2019 14:29, Simon Goldschmidt ha scritto:
"Giuseppe Modugno" wrote:
No it doesn't work. Poll callback is called only 2 times a second.
mbedtls_handshake() must be called several times until it doesn't return
CRYPTO_IN_PROGRESS. With poll callback the handshake would take too much
time.
Another possibility is to fire a timeout that is already expired:
sys_timeout(0, ...).
Do you think there's a better solution?
Not really. If you implement the sys_timeout() thing, you might want to
find a solution that doesn't use one sys_timeout() per connection.
In my case I have only one TLS connection, so it's not important.
And
a fallback to using 'poll' might be good as well (as sys_timeout() can
fail due to lack of resources).
As I said, poll can't be used because it is called only two times per
second.