
* Design I think the design of asio is quite good. It manages to present a modern C++ interface to the arcane and error-prone Berkeley Sockets API (among other things). It takes what I believe is the right approach of mainly providing the low-level interfaces required for a high performance networking library (TCP, UDP sockets with asynchronous operations and I/O multiplexing) and building higher-level functions on top of these primitives. One place where asio stops short, however, is in the area of more high-level user-friendly abstractions. There is one example application (in example/iostreams/daytime_client, unfortunately not linked to in the Review Materials HTML documentation) that illustrates how a high-level Iostreams-based interface can be built using asio and Boost.Iostreams. The "socket_stream" class implemented here is pure gold for users who want to write simple client applications and don't want to know about the demuxer, host resolver, or asynchronous operations. It might be worthwhile to include this class or something like as part of the asio library and not just as an example. * Implementation Excellent. The convention use of Boost.Bind for producing Handlers (e.g. Callbacks) is quite flexible and easy to use. The templated asio::buffer function is an excellent solution for wrapping different containers-of-bytes for sending or receiving network payloads. The code in the library itself is easy to read and follow, as are most of the examples. I've run into some const correctness problems for operations that should likely be const (e.g. basic_*_socket::get_local_endpoint, and ::get_remote_endpoint). For example it would be nice to be able to write this: std::ostream& operator<< (std::ostream& os, const asio::ipv4::tcp::endpoint& endpoint) { return os << endpoint.address().to_string() << ':' << endpoint.port(); } std::ostream& operator<< (std::ostream& os, /* problem here -> */ const asio::socket_acceptor& sock) { sock.get_local_endpoint (endpoint, asio::ignore_error()); return os << endpoint; } But the "const" qualification must be dropped on the second function due to const-correctness issues with ::get_local_endpoint. The lack of IPv6 support does not bother me, and I do not think it should stand in the way of acceptance into Boost, but it is clearly an area for future work. * Documentation The Reference documentation for the library is quite good overall, but it might make sense to elide some of the low-level detail in places. I don't think most users will care that stream_socket is simply a typedef of basic_stream_socket<> (though this could be mentioned on the basic_stream_socket<> documentation). The extra clicks required to get at the documentation you actually need (that of basic_stream_socket) can be frustrating. The Tutorial offers a good introduction to the basics of the library, but I think it could use some additional meat which could likely come from documenting some of the Example programs. As it stands, I think the Doxygen-generated documentation in the Examples section offers very little. More detailed exposition about the form and function of the Examples would be a lot more valuable than the generated reference material that exists now. Additionally, a number of the examples included in the Review Materials appear to be missing from the Examples section of the docs, specifically the chat, echo, iostreams, multicast, ssl and timeouts examples all seem to be ignored. I think the iostreams one in particular would put to rest the questions from people who want a simple, easy-to-use high-level interface. It appears that the valid values for "asio::socket_base::message_flags" are undocumented. This makes the basic_stream::async_* functions rather hard to use :) I think the addition of some benchmark programs might be meaningful and helpful. * Usefulness A networking library is arguably one of the most glaring pieces of functionality missing from C++ and one of the most oft-requested. I think it is not much of a stretch to say that asio could be one of the most popular libraries in Boost if it were to be accepted. * Use I have compiled the test and example programs on a RedHat Linux system with gcc 3.3.4 and another Debian system with gcc 4.0.3. All tests and examples compiled and executed successfully. One small oddity with the Jamfiles seems to be that the top-level directory created in "bin" for this library is boost-asio-proposal-0.3 when I'd expect -0.3.6. In attempts to exercise the multi-threaded capabilities of the library, I ran into a "deadly embrace" problem when I modified the included timer5 example program to run for a longer time with shorter (10 ms) timeouts. I've contacted Chris about this and he's looking into the issue. * Effort I have been toying with asio on and off for a couple of months now. I have probably spent on the order of 12-15 hours reading the documentation and writing small test programs that exercise its features and have had good results interacting with Christopher with comments, suggestions and small bug-fixes. * Me I consider myself quite knowledgeable in the problem domain. I have been writing network-centric applications in C and C++ for many years and have experience using other libraries (e.g. OS-native APIs, ACE, proprietary solutions) that solve some or all of these same problems. * Summary I vote that asio be accepted into Boost. I think it is a fantastic piece of work. -- Caleb Epstein caleb dot epstein at gmail dot com

"Caleb Epstein" <caleb.epstein@gmail.com> wrote in message news:989aceac0512121344q1d7f3249n8fd00870f149d789@mail.gmail.com...
...
I consider myself quite knowledgeable in the problem domain. I have been writing network-centric applications in C and C++ for many years and have experience using other libraries (e.g. OS-native APIs, ACE, proprietary solutions) that solve some or all of these same problems.
* Summary
I vote that asio be accepted into Boost. I think it is a fantastic piece of work.
Caleb, What is your view on the issue of error handling? Are you happy the way it now stands? Would you prefer exceptions be thrown? Would you prefer a "can't ignore" return error code approach? --Beman

On 12/12/05, Beman Dawes <bdawes@acm.org> wrote: What is your view on the issue of error handling? Are you happy the way it
now stands? Would you prefer exceptions be thrown? Would you prefer a "can't ignore" return error code approach?
I prefer that exceptions not be thrown as I think they add little value over the simple error code wrapper in the library right now. They also beg the question of what mechanism would be used to trigger the exception. The un-ignorable error type might be an interesting solution however. -- Caleb Epstein caleb dot epstein at gmail dot com

--- Beman Dawes <bdawes@acm.org> wrote:
Caleb,
What is your view on the issue of error handling? Are you happy the way it now stands? Would you prefer exceptions be thrown? Would you prefer a "can't ignore" return error code approach?
Can I just jump in here and say that the discussion about error handling was originally about the asynchronous callback handlers, where the error is a parameter to the handler, not a return code. However, in the case of the synchronous functions the default behaviour is to throw the error, but this behaviour can be modified on a per-call basis. Cheers, Chris

On 12/12/05, Christopher Kohlhoff <chris@kohlhoff.com> wrote:
--- Beman Dawes <bdawes@acm.org> wrote:
Caleb,
What is your view on the issue of error handling? Are you happy the way it now stands? Would you prefer exceptions be thrown? Would you prefer a "can't ignore" return error code approach?
Can I just jump in here and say that the discussion about error handling was originally about the asynchronous callback handlers, where the error is a parameter to the handler, not a return code.
However, in the case of the synchronous functions the default behaviour is to throw the error, but this behaviour can be modified on a per-call basis.
Thanks for the clarification Chris. I had forgotten to mention this in my review. The synchronous functions offer three nice error handling options out of the box: throw_error, ignore_error and assign_error. And the user can easily provide a custom solution of their own. The names are spelled clearly and there can be no doubt about what they do. I like this interface. http://asio.sourceforge.net/boost-asio-proposal-0.3.6/libs/asio/doc/referenc... -- Caleb Epstein caleb dot epstein at gmail dot com

Hi Caleb, --- Caleb Epstein <caleb.epstein@gmail.com> wrote: <snip>
One place where asio stops short, however, is in the area of more high-level user-friendly abstractions.
If asio does get accepted, and after wider in-the-field experience is gained, i'd like to look at developing a library of higher level abstractions, e.g. common protocols like http, functions for creating endpoints from URLs etc. I see one of the roles of asio as to provide a basis for further abstraction.
There is one example application (in example/iostreams/daytime_client, unfortunately not linked to in the Review Materials HTML documentation) that illustrates how a high-level Iostreams-based interface can be built using asio and Boost.Iostreams. The "socket_stream" class implemented here is pure gold for users who want to write simple client applications and don't want to know about the demuxer, host resolver, or asynchronous operations. It might be worthwhile to include this class or something like as part of the asio library and not just as an example.
I didn't really think it was of high enough quality as-is :) particularly with respect to its interface, but if people think otherwise...
I've run into some const correctness problems for operations that should likely be const (e.g. basic_*_socket::get_local_endpoint, and ::get_remote_endpoint). For example it would be nice to be able to write this:
Oops. I fixed it for stream_socket and datagram_socket, but not for socket_acceptor. Sorry!
std::ostream& operator<< (std::ostream& os, const asio::ipv4::tcp::endpoint& endpoint) { return os << endpoint.address().to_string() << ':' << endpoint.port(); }
BTW, operator<< is now defined for endpoints too, and it outputs in the format you use above.
The Reference documentation for the library is quite good overall, but it might make sense to elide some of the low-level detail in places. I don't think most users will care that stream_socket is simply a typedef of basic_stream_socket<> (though this could be mentioned on the basic_stream_socket<> documentation). The extra clicks required to get at the documentation you actually need (that of basic_stream_socket) can be frustrating.
Some time soon I'm going to look at using doxygen's XML output to generate the output in a friendlier format, and when I do this I'll automatically clone the documentation from basic_stream_socket<> to stream_socket, etc. I do like how doxygen keeps the documentation close to the code, but I find its generated HTML a little quirky. <snip>
It appears that the valid values for "asio::socket_base::message_flags" are undocumented. This makes the basic_stream::async_* functions rather hard to use :)
They are, but not linked to from anywhere it seems. You can find them on the socket_base page. I should add links to them from the functions that let you use them. <snip> Cheers, Chris

Christopher Kohlhoff wrote:
--- Caleb Epstein <caleb.epstein@gmail.com> wrote: [...]
The Reference documentation for the library is quite good overall, but it might make sense to elide some of the low-level detail in places. I don't think most users will care that stream_socket is simply a typedef of basic_stream_socket<> (though this could be mentioned on the basic_stream_socket<> documentation). The extra clicks required to get at the documentation you actually need (that of basic_stream_socket) can be frustrating.
Some time soon I'm going to look at using doxygen's XML output to generate the output in a friendlier format, and when I do this I'll automatically clone the documentation from basic_stream_socket<> to stream_socket, etc. I do like how doxygen keeps the documentation close to the code, but I find its generated HTML a little quirky.
You really should look at the Doxygen XML output integration into the BoostBook documentation chain. In particular it allows for the integration of non-reference documentation with the reference style docs from Doxygen. For example see the Program Options lib <http://www.boost.org/doc/html/program_options.html> (uses Dox and BoostBook), the String Algo lib <http://www.boost.org/doc/html/string_algo.html> (again Dox+BoostBook), and in CVS HEAD Xpressive which is Dox and Quickbook. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

--- Rene Rivera <grafik.list@redshift-software.com> wrote:
You really should look at the Doxygen XML output integration into the BoostBook documentation chain. In particular it allows for the integration of non-reference documentation with the reference style docs from Doxygen. For example see the Program Options lib <http://www.boost.org/doc/html/program_options.html> (uses Dox and BoostBook), the String Algo lib <http://www.boost.org/doc/html/string_algo.html> (again Dox+BoostBook), and in CVS HEAD Xpressive which is Dox and Quickbook.
Ooh, thanks for the tip. That looks like a much nicer way to go. Cheers, Chris
participants (4)
-
Beman Dawes
-
Caleb Epstein
-
Christopher Kohlhoff
-
Rene Rivera