I have a client program which talks to a server using a message-based protocol. Every request is matched by 1 or more responses.
It's possible for multiple requests to be queued on a socket at once, and the I/O is done on a separate thread using non-blocking I/O. The algorithm is basically to wait for the socket to become readable and/or writable using select() (based on whether there's requests to send and/or responses to read), then to do the read and/or write. This works fine.
Now, if I enable SSL on the socket, we have to use SSL_Read()/SSL_Write() instead of send()/recv(). Now, my question is, can I call SSL_Write() after SSL_Read() fails with WANT_READ/WANT_WRITE (or vice versa), or do I have to keep calling SSL_Write() until it succeeds/fails? The documentation doesn't seem to explicitly rule this out, but it's kind of vague here.