gpt4 book ai didi

linux - 有没有办法将 stdin/stdout fds 转换为一个 fd?

转载 作者:太空狗 更新时间:2023-10-29 11:40:39 25 4
gpt4 key购买 nike

我想从 stdin 处理 SSL,并从 stdout 发送 SSL,但 OpenSSL 在 set fd 调用中只接受一个文件描述符:

SSL_set_fd(ssl, sock);

有没有办法将 stdin 和 stdout 文件描述符合并为一个?

我意识到我可以创建一个只从 stdin/out 读取并写入文件描述符的进程,但我试图想出一种方法来避免额外的处理层。

最佳答案

您似乎想使用 SSL_set_rfd() 和 SSL_set_wfd()。来自 the manual :

SSL_set_rfd() and SSL_set_wfd() perform the respective action, but only for the read channel or the write channel, which can be set independently.

关于linux - 有没有办法将 stdin/stdout fds 转换为一个 fd?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52006723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com