Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

http::icy_stream

Stream wrapper to process Shoutcast HTTP responses.

Synopsis

Defined in header <boost/beast/_experimental/http/icy_stream.hpp>

template<
    class NextLayer>
class icy_stream
Types

Name

Description

executor_type

The type of the executor associated with the object.

next_layer_type

The type of the next layer.

Member Functions

Name

Description

async_read_some

Start an asynchronous read.

async_write_some

Start an asynchronous write.

get_executor

Get the executor associated with the object.

icy_stream

Constructor.

next_layer

Get a reference to the next layer.

operator=

read_some

Read some data from the stream.

write_some

Write some data to the stream.

~icy_stream

Destructor.

Description

This wrapper replaces the word "ICY" in the first HTTP response received on the connection, with "HTTP/1.1". This allows the Beast parser to be used with Shoutcast servers, which send a non-standard HTTP message as the response. For asynchronous operations, the application must ensure that they are are all performed within the same implicit or explicit strand.

Thread Safety

Distinct objects: Safe.

Shared objects: Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.

Example

To use the http::icy_stream template with an tcp_stream you would write:

http::icy_stream<tcp_stream> is(ioc);
Template Parameters

Type

Description

NextLayer

The type representing the next layer, to which data will be read and written during operations. For synchronous operations, the type must support the SyncStream concept. For asynchronous operations, the type must support the AsyncStream concept.

Remarks

A stream object must not be moved or destroyed while there are pending asynchronous operations associated with it.

Concepts

AsyncStream, SyncStream


PrevUpHomeNext