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 an old version of boost. Click here for the latest version's documentation home page.
PrevUpHomeNext
basic_socket_acceptor::close (2 of 2 overloads)

Close the acceptor.

boost::system::error_code close(
    boost::system::error_code & ec);

This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.

A subsequent call to open() is required before the acceptor can again be used to again perform socket accept operations.

Parameters

ec

Set to indicate what error occurred, if any.

Example
boost::asio::ip::tcp::acceptor acceptor(io_service);
...
boost::system::error_code ec;
acceptor.close(ec);
if (ec)
{
  // An error occurred.
}

PrevUpHomeNext