rationale.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Rationale</title>
  5. <link rel="stylesheet" href="../../boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
  7. <link rel="home" href="../../index.html" title="Asio">
  8. <link rel="up" href="../overview.html" title="Overview">
  9. <link rel="prev" href="../overview.html" title="Overview">
  10. <link rel="next" href="core.html" title="Core Concepts and Functionality">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../asio.png"></td></tr></table>
  14. <hr>
  15. <div class="spirit-nav">
  16. <a accesskey="p" href="../overview.html"><img src="../../prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../home.png" alt="Home"></a><a accesskey="n" href="core.html"><img src="../../next.png" alt="Next"></a>
  17. </div>
  18. <div class="section">
  19. <div class="titlepage"><div><div><h3 class="title">
  20. <a name="asio.overview.rationale"></a><a class="link" href="rationale.html" title="Rationale">Rationale</a>
  21. </h3></div></div></div>
  22. <p>
  23. Most programs interact with the outside world in some way, whether it be
  24. via a file, a network, a serial cable, or the console. Sometimes, as is the
  25. case with networking, individual I/O operations can take a long time to complete.
  26. This poses particular challenges to application development.
  27. </p>
  28. <p>
  29. Asio provides the tools to manage these long running operations, without
  30. requiring programs to use concurrency models based on threads and explicit
  31. locking.
  32. </p>
  33. <p>
  34. The Asio library is intended for programmers using C++ for systems programming,
  35. where access to operating system functionality such as networking is often
  36. required. In particular, Asio addresses the following goals:
  37. </p>
  38. <div class="itemizedlist"><ul class="itemizedlist" type="disc">
  39. <li class="listitem">
  40. <span class="bold"><strong>Portability.</strong></span> The library should support
  41. a range of commonly used operating systems, and provide consistent behaviour
  42. across these operating systems.
  43. </li>
  44. <li class="listitem">
  45. <span class="bold"><strong>Scalability.</strong></span> The library should facilitate
  46. the development of network applications that scale to thousands of concurrent
  47. connections. The library implementation for each operating system should
  48. use the mechanism that best enables this scalability.
  49. </li>
  50. <li class="listitem">
  51. <span class="bold"><strong>Efficiency.</strong></span> The library should support
  52. techniques such as scatter-gather I/O, and allow programs to minimise
  53. data copying.
  54. </li>
  55. <li class="listitem">
  56. <span class="bold"><strong>Model concepts from established APIs, such as BSD
  57. sockets.</strong></span> The BSD socket API is widely implemented and understood,
  58. and is covered in much literature. Other programming languages often
  59. use a similar interface for networking APIs. As far as is reasonable,
  60. Asio should leverage existing practice.
  61. </li>
  62. <li class="listitem">
  63. <span class="bold"><strong>Ease of use.</strong></span> The library should provide
  64. a lower entry barrier for new users by taking a toolkit, rather than
  65. framework, approach. That is, it should try to minimise the up-front
  66. investment in time to just learning a few basic rules and guidelines.
  67. After that, a library user should only need to understand the specific
  68. functions that are being used.
  69. </li>
  70. <li class="listitem">
  71. <span class="bold"><strong>Basis for further abstraction.</strong></span> The library
  72. should permit the development of other libraries that provide higher
  73. levels of abstraction. For example, implementations of commonly used
  74. protocols such as HTTP.
  75. </li>
  76. </ul></div>
  77. <p>
  78. Although Asio started life focused primarily on networking, its concepts
  79. of asynchronous I/O have been extended to include other operating system
  80. resources such as serial ports, file descriptors, and so on.
  81. </p>
  82. </div>
  83. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  84. <td align="left"></td>
  85. <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2014 Christopher M. Kohlhoff<p>
  86. Distributed under the Boost Software License, Version 1.0. (See accompanying
  87. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  88. </p>
  89. </div></td>
  90. </tr></table>
  91. <hr>
  92. <div class="spirit-nav">
  93. <a accesskey="p" href="../overview.html"><img src="../../prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../home.png" alt="Home"></a><a accesskey="n" href="core.html"><img src="../../next.png" alt="Next"></a>
  94. </div>
  95. </body>
  96. </html>