[asio-users] asio version 0.3.5 released
Brought to you by:
chris_kohlhoff
From: Christopher K. <ch...@ko...> - 2005-11-18 11:27:00
|
asio version 0.3.5 has been released. It may be downloaded from the asio sourceforge page at http://asio.sourceforge.net. This release is focused on cleaning up and refining the interface. The most significant changes include consolidation and renaming of read and write functions, and the removal of the buffers() function in favour of just buffer(). Code that uses asio will need to be updated. The changes since asio 0.3.4 include: - Consolidated the free functions read(), read_n() and read_at_least_n() into a function named read(); write(), write_n() and write_at_least_n() into just write(); and likewise for their asynchronous counterparts. The default behaviour of read() and write() is now to attempt to transfer all of the data (i.e. equivalent to old read_n() and write_n()). The _at_least_n() behaviour can be obtained by passing a Completion_Condition function object: asio::read(s, bufs, asio::transfer_at_least(32)); - Renamed the Stream concept's read(), async_read(), write() and async_write() functions to read_some(), async_read_some(), write_some() and async_write_some() respectively. This was done to make it obvious to a library user that the operation can result in a short read or write. The name write() in particular was found to be error prone, since most of the time it will successfully transfer all of the data. Only occasional calls would result in a short write, leading to hard to find bugs. - Graceful connection closure now causes a read to complete with an error code (asio::error::eof) rather than returning 0. This removes the need for separate total_bytes_transferred and last_bytes_transferred handler parameters. It allows a function, such as asio::read() and asio::write(), to return an error to indicate that it is unable to fulfil its contract due to EOF. - Removed the asio::buffers() function and the ability to automatically chain buffer objects together. Instead, the asio::buffer() function now returns a type that meets the Const_Buffers or Mutable_Buffers concepts as appropriate. Scatter-gather I/O should now be performed by explicitly placing const_buffer or mutable_buffer objects into a container (such as std::vector, std::list or boost::array). To read into a single buffer you would now write: sock.read(asio::buffer(data, length)); To send multiple buffers you would use something like: std::vector<asio::const_buffer> bufs; bufs.push_back(asio::buffer(data1, length1)); bufs.push_back(asio::buffer(data2, length2)); sock.write(bufs); - Added comparison operators to the asio::ipv4::tcp::endpoint and asio::ipv4::udp::endpoint classes. - Removed the error handling expression templates. This functionality is better covered by a library such as Boost.Lambda. - Removed the fixed_buffer class from the library's public interface. The underlying buffer storage is no longer a template parameter on the buffered*_stream classes. - Removed the wrapped_handler class from the library's public interface. - Removed the consuming_buffers class from the libary's public interface. - Added new certificates for the SSL example, as the original ones expired after one month. - Used implementation-defined types rather than void* in the Socket_Option and IO_Control_Command concepts to avoid losing type safety. - Various code cleanup and bug fixes. - Added support for MSVC 8.0. - Documentation improvements. |