This article is from the Secure Sockets Layer Discussion List FAQ, by Shannon Appel SAppel@consensus.com with numerous contributions by others.
The write queue is serviced by the public function called
SSLServiceWriteQueue(). It is called in a number of places in
ssltrspt.c, including with every call to SSLWrite(). Data to be
written is sent to the I/O layer as you exit out of the write
function (for example, right near the bottom of SSLWrite).
If SSLWrite() returns SSLWouldBlockError, then make a call to
SSLServiceWriteQueue() to service the write queue. (You could
instead make a call to SSLWrite() with more data to be written, but
this is unlikely.)
The write queue is not serviced by a separate execution thread. The
write queue mechanism was designed to support non-blocking I/O
without undue overhead.
 
Continue to: