• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 6,  comments - 61,  trackbacks - 0

             

            Boost.Asio is a cross-platform C++ library for network programming that provides developers with a consistent asynchronous I/O model using a modern C++ approach.

            Boost.Asio是一個(gè)跨平臺(tái)的C + +庫(kù),它用現(xiàn)代C++方法為網(wǎng)絡(luò)編程人員提供一致的異步I/O模型。

             

            Using Boost.Asio

            How to use Boost.Asio in your applications. Includes information on library dependencies and supported platforms.

            如何在你的應(yīng)用程序中使用Boost.Asio庫(kù),以及關(guān)于庫(kù)依賴(lài)和所支持平臺(tái)信息。 

            Tutorial

            A tutorial that introduces the fundamental concepts required to use Boost.Asio, and shows how to use Boost.Asio to develop simple client and server programs.

            介紹使用Boost.Asio必備的基本概念,同時(shí)示范如何使用Boost.Aaio開(kāi)發(fā)簡(jiǎn)單的客戶(hù)端\服務(wù)器程序。

            Examples

            Examples that illustrate the use of Boost.Asio in more complex applications.

            更加復(fù)雜的應(yīng)用程序中使用Boost.Asio的示例。

            Reference

            Detailed class and function reference.

            類(lèi)和函數(shù)的詳細(xì)參考

            Design

            Rationale and design information for Boost.Asio.

            Boost.Asio庫(kù)的基本原理及設(shè)計(jì)思路。

            Supported Platforms

             支持平臺(tái):

            The following platforms and compilers have been tested:

            已測(cè)試的平臺(tái)和編譯器:

             

            • Win32 and Win64 using Visual C++ 7.1 and Visual C++ 8.0.
            • Win32 using MinGW.
            • Win32 using Cygwin. (__USE_W32_SOCKETS must be defined.)
            • Linux (2.4 or 2.6 kernels) using g++ 3.3 or later.
            • Solaris using g++ 3.3 or later.
            • Mac OS X 10.4 using g++ 3.3 or later.

            The following platforms may also work:

            以下的平臺(tái)可能也可以使用:

             

            • AIX 5.3 using XL C/C++ v9.
            • HP-UX 11i v3 using patched aC++ A.06.14.
            • QNX Neutrino 6.3 using g++ 3.3 or later.
            • Solaris using Sun Studio 11 or later.
            • Tru64 v5.1 using Compaq C++ v7.1.
            • Win32 using Borland C++ 5.9.2

            Dependencies

            依賴(lài)性:

            The following libraries must be available in order to link programs that use Boost.Asio:

            以下是使用Boost.Asio 必需的鏈接庫(kù):

             

            • Boost.System for the boost::system::error_code and boost::system::system_error classes.
            • Boost.Regex (optional) if you use any of the read_until() or async_read_until() overloads that take a boost::regex parameter.
            • OpenSSL (optional) if you use Boost.Asio's SSL support.

             

             

            Boost.System 中的 boost::system::error_codeboost::system::system_error 類(lèi)。

            Boost.Regex (可選)。read_until() 或 async_read_until() 函數(shù)的重載形式都需要 boost::regex 參數(shù)。 如果你使用它們,則需要Boost.Regex庫(kù)。

            OpenSSL (可選) 。如果需要Boost.Asio支持SSL,則需要OpenSSL庫(kù)

             

            Furthermore, some of the examples also require the Boost.Thread, Boost.Date_Time or Boost.Serialization libraries.

            另外,一些例子需要提供Boost.Thread,Boost.Date_Time 或Boost.Serialization 庫(kù)的支持。

             

            [Note] Note

            With MSVC or Borland C++ you may want to add -DBOOST_DATE_TIME_NO_LIB and -DBOOST_REGEX_NO_LIB to your project settings to disable autolinking of the Boost.Date_Time and Boost.Regex libraries respectively. Alternatively, you may choose to build these libraries and link to them.

             

            注意:

            使用MSVC或Borland C++,你可能需要在“工程設(shè)置”中分別添加 -DBOOST_DATE_TIME_NO_LIB-DBOOST_REGEX_NO_LIB 聲明,分別禁止Boost.Date_Time和Boost.Regex的自動(dòng)鏈接,當(dāng)然你也可以這樣做:build這兩個(gè)庫(kù),然后鏈接。

            Building Boost Libraries

             編譯Boost庫(kù):

            You may build the subset of Boost libraries required to use Boost.Asio and its examples by running the following command from the root of the Boost download package:

            你可以在下載包的根目錄下執(zhí)行如下的命令來(lái)編譯Boost.Asio所必需的Boost庫(kù)子集 


            bjam --with-system --with-thread --with-date_time --with-regex --with-serialization stage

            This assumes that you have already built bjam. Consult the Boost.Build documentation for more details.

            這里假設(shè)你已經(jīng)編譯了bjam。請(qǐng)參考Boost.Build文檔以獲得更多信息。

            Macros

            The macros listed in the table below may be used to control the behaviour of Boost.Asio.

            下表中的宏用來(lái)控制Boost.Asio狀態(tài)

            Macro

            Description

            BOOST_ASIO_ENABLE_BUFFER_DEBUGGING

            Enables Boost.Asio's buffer debugging support, which can help identify when invalid buffers are used in read or write operations (e.g. if a std::string object being written is destroyed before the write operation completes).

            When using Microsoft Visual C++, this macro is defined automatically if the compiler's iterator debugging support is enabled, unless BOOST_ASIO_DISABLE_BUFFER_DEBUGGING has been defined.

            When using g++, this macro is defined automatically if standard library debugging is enabled (_GLIBCXX_DEBUG is defined), unless BOOST_ASIO_DISABLE_BUFFER_DEBUGGING has been defined.

            BOOST_ASIO_DISABLE_BUFFER_DEBUGGING

            Explictly disables Boost.Asio's buffer debugging support.

            BOOST_ASIO_DISABLE_DEV_POLL

            Explicitly disables /dev/poll support on Solaris, forcing the use of a select-based implementation.

            BOOST_ASIO_DISABLE_EPOLL

            Explicitly disables epoll support on Linux, forcing the use of a select-based implementation.

            BOOST_ASIO_DISABLE_KQUEUE

            Explicitly disables kqueue support on Mac OS X and BSD variants, forcing the use of a select-based implementation.

            BOOST_ASIO_DISABLE_IOCP

            Explicitly disables I/O completion ports support on Windows, forcing the use of a select-based implementation.

            BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN

            By default, Boost.Asio will automatically define WIN32_LEAN_AND_MEAN when compiling for Windows, to minimise the number of Windows SDK header files and features that are included. The presence of BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN prevents WIN32_LEAN_AND_MEAN from being defined.

            BOOST_ASIO_NO_DEFAULT_LINKED_LIBS

            When compiling for Windows using Microsoft Visual C++ or Borland C++, Boost.Asio will automatically link in the necessary Windows SDK libraries for sockets support (i.e. ws2_32.lib and mswsock.lib, or ws2.lib when building for Windows CE). The BOOST_ASIO_NO_DEFAULT_LINKED_LIBS macro prevents these libraries from being linked.

            BOOST_ASIO_SOCKET_STREAMBUF_MAX_ARITY

            Determines the maximum number of arguments that may be passed to the basic_socket_streambuf class template's connect member function. Defaults to 5.

            BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY

            Determines the maximum number of arguments that may be passed to the basic_socket_iostream class template's constructor and connect member function. Defaults to 5.

            BOOST_ASIO_ENABLE_CANCELIO

            Enables use of the CancelIo function on older versions of Windows. If not enabled, calls to cancel() on a socket object will always fail with asio::error::operation_not_supported when run on Windows XP, Windows Server 2003, and earlier versions of Windows. When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used.

            The CancelIo function has two issues that should be considered before enabling its use:

            * It will only cancel asynchronous operations that were initiated in the current thread.

            * It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.

            For portable cancellation, consider using one of the following alternatives:

            * Disable asio's I/O completion port backend by defining BOOST_ASIO_DISABLE_IOCP.

            * Use the socket object's close() function to simultaneously cancel the outstanding operations and close the socket.


            Basic Skills

            基本技能

            The tutorial programs in this first section introduce the fundamental concepts required to use the asio toolkit. Before plunging into the complex world of network programming, these tutorial programs illustrate the basic skills using simple asynchronous timers.

            本指南的第一部分主要介紹使用Asio工具包所需要了解的基本概念。在進(jìn)入復(fù)雜網(wǎng)絡(luò)編程世界之前,這些示例程序?qū)⑴e一些使用簡(jiǎn)單異步定時(shí)器的例子。

             

             

            Timer1、使用同步定時(shí)器
            Timer2、使用異步定時(shí)器
            Timer3、回調(diào)函數(shù)綁定參數(shù)
            Timer4、成員函數(shù)作為回調(diào)函數(shù)
            Timer5、多線程回調(diào)同步

            Introduction to Sockets

            介紹套接字

            The tutorial programs in this section show how to use asio to develop simple client and server programs. These tutorial programs are based around the daytime protocol, which supports both TCP and UDP.

            這部分的實(shí)例主要介紹如何使Asio開(kāi)發(fā)簡(jiǎn)單的客戶(hù)端\服務(wù)器程序。這些程序都基于同時(shí)支持TCP和UDP協(xié)議的daytime協(xié)議。

            The first three tutorial programs implement the daytime protocol using TCP.

            前三個(gè)程序用TCP實(shí)現(xiàn)daytime協(xié)議。

             

             

            Daytime1、同步TCP daytime客戶(hù)端
            Daytime2、同步TCP daytime服務(wù)器
            Daytime3、異步TCP daytime服務(wù)器

            The next three tutorial programs implement the daytime protocol using UDP.

            接下來(lái)的三個(gè)程序用UDP實(shí)現(xiàn)daytime協(xié)議。

             

             

            Daytime4、同步UDP daytime客戶(hù)端
            Daytime5、同步UDP daytime服務(wù)器
            Daytime6、異步UDP daytime服務(wù)器

            The last tutorial program in this section demonstrates how asio allows the TCP and UDP servers to be easily combined into a single program.

            本部分的最后一個(gè)程序演示了asio怎樣將TCPUDP服務(wù)器簡(jiǎn)易的組合到一個(gè)程序里

             

            Daytime7、結(jié)合了TCP/UDP的同步服務(wù)器

            posted on 2008-04-20 01:14 王曉軒 閱讀(7939) 評(píng)論(1)  編輯 收藏 引用 所屬分類(lèi): C\C++
            久久久久九国产精品| 人妻无码αv中文字幕久久琪琪布| 久久午夜伦鲁片免费无码| 日韩久久久久久中文人妻| 久久久国产精品网站| 无码任你躁久久久久久老妇| 人妻无码αv中文字幕久久| 久久久久久久尹人综合网亚洲| 久久婷婷五月综合97色直播| 99久久精品国产一区二区| 久久伊人精品青青草原高清| 久久受www免费人成_看片中文| 久久久久亚洲av无码专区导航| 国产免费久久久久久无码| 一本一本久久A久久综合精品 | 99久久99久久精品国产片果冻| 久久精品国产精品亚洲下载| 热re99久久精品国99热| 一级A毛片免费观看久久精品| 久久国产精品99久久久久久老狼 | 亚洲精品乱码久久久久久蜜桃| 国内精品伊人久久久久av一坑| 少妇久久久久久被弄到高潮| 久久电影网2021| 九九久久99综合一区二区| 久久人人添人人爽添人人片牛牛| 国产精品美女久久久网AV| 99久久无色码中文字幕| 色欲久久久天天天综合网| 久久精品国产亚洲AV香蕉| 亚洲国产精品综合久久网络| 九九热久久免费视频| 国产精品99久久精品爆乳| 久久婷婷久久一区二区三区| 国产V亚洲V天堂无码久久久| 无码人妻久久一区二区三区免费丨 | 99久久精品日本一区二区免费 | A级毛片无码久久精品免费| 久久综合给合综合久久| 久久久久无码精品国产app| 久久精品亚洲男人的天堂|