Boost.Asio

Boost.Asio is a cross-platform C ++ library for the underlying network and I / O programming, which uses modern C ++ approach provides a consistent asynchronous model for developers.

Fundamental

Most programs interact with the outside world in some way, either through files, network, or serial cable console. Sometimes, as in the case with the network, a single I / O operation may take a long time to complete. This poses special challenges for application development.

Boost.Asio provides tools for managing these long-running operations without having to program using the threading and concurrency model based on an explicit lock.

Boost.Asio library for C ++ programmers to program the system to use, the systems often require access to OS functions such as a network or the like. In particular, Boost.Asio achieve the following objectives:

  • portability. The library should support a range of commonly used OS, and provide consistent behavior between these OS.
  • Scalability. The library should be expanded to promote the development of network applications thousands of concurrent connections. Each operating system library implementation mechanism can best achieve this scalability should be used.
  • effectiveness. The library should support aggregation of distributed I / O technology, and allow the program to copy the data to a minimum.
  • Conceptual model from an established API, such as BSD sockets. BSD Socket API is widely understood and implemented, and are involved in many references. Other programming languages are usually similar interface for networking API. Within a reasonable range, Boost.Asio should take advantage of existing practices.
  • Easy to use. The library should be used instead of the toolbox framework approach, thus providing a lower barrier to entry for new users. That is, in case it should try to learn some basic rules and guidelines to minimize upfront investment. After that, the library users only need to know the specific function being used.
  • Further abstract foundation. The library should allow developers to provide a higher level of abstraction of the other libraries. For example, to achieve common protocols (e.g., HTTP) of.

Although Boost.Asi O is initially focused on the network, but it is asynchronous I / O concept has been extended to include other operating system resources, such as a serial port, file descriptors.

The core concepts and features

Boost.Asio be used to perform synchronous and asynchronous operation of the I / O objects (e.g. a socket). But before using Boost Asio, understand Boost Asio the framework of the relevant part of the map, you kind of how it is used in the program will become useful.

Guess you like

Origin www.cnblogs.com/wangzxblog/p/11887521.html