Handling Non-Blocking I/O Errors in OpenSSL

SSL_accept()

After result of:Select on:Try this next:
<0, SSL_ERROR_WANT_READ R SSL_accept()
<0, SSL_ERROR_WANT_WRITE W SSL_accept()
0, SSL_ERROR_SYSCALL   nothing (illegal EOF)
<0, SSL_ERROR_SYSCALL   see errno

SSL_connect()

After result of:Select on:Try this next:
<0, SSL_ERROR_WANT_READ R SSL_connect()
<0, SSL_ERROR_WANT_WRITE W SSL_connect()
0, SSL_ERROR_SYSCALL   nothing (illegal EOF)
<0, SSL_ERROR_SYSCALL   see errno

SSL_read()

After result of:Select on:Try this next:
<0, SSL_ERROR_WANT_READ R SSL_read()
<0, SSL_ERROR_WANT_WRITE W SSL_read()
0, SSL_ERROR_ZERO_RETURN   nothing (socket is shut down)

SSL_write()

After result of:Select on:Try this next:
<0, SSL_ERROR_WANT_READ R SSL_write()
<0, SSL_ERROR_WANT_WRITE W SSL_write()
0, SSL_ERROR_ZERO_RETURN   nothing (socket is shut down)

SSL_shutdown()

After result of:Select on:Try this next:
-1, SSL_ERROR_WANT_READ R SSL_shutdown()
-1, SSL_ERROR_WANT_WRITE W SSL_shutdown()
0 R SSL_shutdown()