【问题标题】:How to use boost::asio to abstract file descriptors?如何使用 boost::asio 来抽象文件描述符?
【发布时间】:2012-04-10 14:28:51
【问题描述】:

是否有关于如何将 Boost::asio 抽象用于多个 Linux 文件描述符的教程?

我基本上是在寻找更好的抽象来在一个单独的线程上选择多个文件描述符,并带有超时。

【问题讨论】:

    标签: c++ linux boost boost-asio


    【解决方案1】:

    不是教程,而是一个工作示例:

    http://article.gmane.org/gmane.comp.lib.boost.asio.user/2699http://lists.boost.org/Archives/boost/2008/10/143892.php

    他们基本上使用boost::asio::posix::stream_descriptor 将本机文件描述符与ASIO 一起使用。

    在 boost 文档中还有一个例子:POSIX-specific chat client demonstrates how to use the posix::stream_descriptor class to perform console input and output

    也许您想使用reactor style io_service。

    【讨论】:

    • 您的第一个链接没有示例可供下载。
    猜你喜欢
    • 1970-01-01
    • 2011-06-08
    • 2012-08-11
    • 2016-05-04
    • 1970-01-01
    • 2012-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多