Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查是否可以使用 写入 SSL 流SSL_write()?
SSL_write()
我需要类似的东西
if(SSL_write_possible(ssl)) SSL_write();
看起来您想使用 OpenSSL 进行非阻塞 I/O。如果是这种情况,我建议您使用 SSL_get_wfd() 和 select() 来检测底层文件描述符何时准备就绪。
事情是我确实有异步 IO,但我现在使用缓冲区并写入 SSL,后者写入 BIO,然后我从 BIO 读取并写入另一个异步流。我通过修复我正在使用的握手代码解决了这个问题。所以现在写永远不会失败。:)