此 C 代码使用的 select_wait() 函数在哪里?
在搜索 的答案时这个问题我发现此示例代码 看起来正是我需要的,只是它调用了
select_wait()
non_blocking.h 但无法定位。
select_wait() 是专有代码吗?它是我可以获得的某些 DLL 的入口点吗?如何复制 select_wait() 所做的事情?简单地忽略 select_wait() 并立即重试 BIO_read/write 调用看起来安全吗?
更新:在测试代码时,select_wait() 似乎是必要的,因为如果输入不可用,BIO_read 将挂起。然而,RSA 的示例代码在跳出 for 循环之前最多执行一次成功的 BIO_read,因此他们的代码也无法接受来自 Chrome 的 POST,如原始问题中所述。
While searching for an answer to this question I found this sample code which looks like just what I need except it calls
select_wait()
which is defined in non_blocking.h but which is otherwise unlocatable.
Is select_wait() proprietary code? Is it an entrypoint in some DLL I can get? How do I duplicate whatever select_wait() does? Does it look safe to simply ignore select_wait() and immediately retry the BIO_read/write calls?
Update: In testing the code, the select_wait() appears necessary because BIO_read will hang if input isn't available. However, RSA's sample code does at most one successful BIO_read before breaking out of the for-loop, so their code also would fail to accept a POST from Chrome as described in the original question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然它是专有的 BSAFE 库/框架的一部分
Apparently it's part of the proprietary BSAFE library/framework
如果您有套接字句柄,请使用 select() WinSock API函数。
If you have a socket handle, use select() WinSock API function.