Topic: adapting reader/writer thread design to cyassl
I have a standard TCP socket application running with lwip and FreeRTOS, and I would like to secure it with cyassl.
The application is a CAN packet relay, so we don't know if the next io over the network will be a read or a write. I currently implement this by having 1 thread dedicated to reading the socket and another thread for writing.
As I understand it, this will not work for cyassl. Protecting read/write with a mutex will also not work, because the reader thread will hold the mutex and block the writer until something is received.
So my question is, what is a good way to do random read/write with cyassl?