如何了解 Boost asio 中 SSL 套接字的状态
在正常连接中,假设有一个套接字:
boost::asio::ip::tcp::socket socket_;
可以通过以下方式询问套接字状态:
if (socket_.is_open()) { ... }
但是,在安全连接中,假设
boost::asio::ssl::stream<boost::asio::ip::tcp::socket> socket_;
有一个套接字: socket_is_open()
方法code> 对象,所以问题:
是否有类似的方法来知道套接字状态?
In normal connections, asuming a socket:
boost::asio::ip::tcp::socket socket_;
it's possible ask the socket status with:
if (socket_.is_open()) { ... }
But instead, in secure connections, asuming a socket:
boost::asio::ssl::stream<boost::asio::ip::tcp::socket> socket_;
There is not an is_open()
method for the socket_
object, so the question:
Is there a similar way to know the socket status?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有关更多信息,请参阅文档信息。
see the documentation for more information.