Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2004-09-13 01:12:45


Hi all,

In light of some of the recent discussion about sockets (e.g. the
"behond IOStreams" thread), I'd like to take this opportunity to
announce "asio". asio will be going live in a commercial system in a
little over a month, and I think it's now at a point where it is
suitable for use by a wider audience. I would like to think that asio
has potential as the basis of a boostified networking library, or that
at least it can inject some ideas into the discussion.

asio is a cross-platform library for doing network programming, using a
"modern" c++ style. It is designed to use an asynchronous I/O model for
virtually all operations, even when the OS lacks native asynchronous
I/O. The library is intended to ease the development of scalable
network applications through the use of a proactive event-driven
architecture.

You can download asio from:

  http://tenermerx.com/programming/cpp/asio/asio-0.1.12.tar.gz

I have also put the generated documentation online at:

  http://tenermerx.com/programming/cpp/asio/asio-0.1.12/doc/html/

asio supports Win32 and Linux, and has been infrequently tested on
Solaris. It is free for any use.

Here is a sample usage of asio showing how to receive data on a socket:

  char buf[BUFSIZ];

  void handle_receive(asio::error& e, size_t bytes_recvd)
  {
    if (!e) { /*...*/ }
  }

  int start_receiving(asio::socket& s)
  {
    s.async_recv(buf, BUFSIZ,
        boost::bind(
          handle_receive,
          asio::arg::error,
          asio::arg::bytes_recvd));
  }

I have been working on asio for well over a year and, as I said, it
will be going into production in a commercial system in a little over a
month. For commercial reasons I can't give too much detail, but I can
say that asio has been used to develop a custom HTTP proxy that
supports hundreds of concurrent connections.

The inspiration for asio was the work of Alex Libman in developing a
"portable Proactor framework" for ACE (see http://www.terabit.com.au).
This is a Proactor that can use select or a similar synchronous event
demultiplexer if no more appropriate OS mechanism is available.

Regards,
Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk