Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:35

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
0008 //
0009 
0010 #ifndef BOOST_BEAST_WEBSOCKET_SSL_HPP
0011 #define BOOST_BEAST_WEBSOCKET_SSL_HPP
0012 
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <boost/beast/websocket/teardown.hpp>
0015 #include <boost/asio/ip/tcp.hpp>
0016 #include <boost/asio/ssl/stream.hpp>
0017 
0018 namespace boost {
0019 namespace beast {
0020 
0021 /** Tear down a `net::ssl::stream`.
0022 
0023     This tears down a connection. The implementation will call
0024     the overload of this function based on the `Stream` parameter
0025     used to consruct the socket. When `Stream` is a user defined
0026     type, and not a `net::ip::tcp::socket` or any
0027     `net::ssl::stream`, callers are responsible for
0028     providing a suitable overload of this function.
0029 
0030     @param role The role of the local endpoint
0031 
0032     @param stream The stream to tear down.
0033 
0034     @param ec Set to the error if any occurred.
0035 */
0036 template<class SyncStream>
0037 void
0038 teardown(
0039     role_type role,
0040     net::ssl::stream<SyncStream>& stream,
0041     error_code& ec);
0042 
0043 /** Start tearing down a `net::ssl::stream`.
0044 
0045     This begins tearing down a connection asynchronously.
0046     The implementation will call the overload of this function
0047     based on the `Stream` parameter used to consruct the socket.
0048     When `Stream` is a user defined type, and not a
0049     `net::ip::tcp::socket` or any `net::ssl::stream`,
0050     callers are responsible for providing a suitable overload
0051     of this function.
0052 
0053     @param role The role of the local endpoint
0054 
0055     @param stream The stream to tear down.
0056 
0057     @param handler The completion handler to invoke when the operation
0058     completes. The implementation takes ownership of the handler by
0059     performing a decay-copy. The equivalent function signature of
0060     the handler must be:
0061     @code
0062     void handler(
0063         error_code const& error // result of operation
0064     );
0065     @endcode
0066     If the handler has an associated immediate executor,
0067     an immediate completion will be dispatched to it.
0068     Otherwise, the handler will not be invoked from within
0069     this function. Invocation of the handler will be performed in a
0070     manner equivalent to using `net::post`.
0071 
0072     @par Per-Operation Cancellation
0073 
0074     This asynchronous operation supports cancellation for the following
0075     net::cancellation_type values:
0076 
0077     @li @c net::cancellation_type::terminal
0078     @li @c net::cancellation_type::partial
0079     @li @c net::cancellation_type::total
0080 
0081     if they are also supported by the socket's @c async_teardown
0082     and @c async_shutdown operation.
0083 
0084 */
0085 template<class AsyncStream, class TeardownHandler>
0086 void
0087 async_teardown(
0088     role_type role,
0089     net::ssl::stream<AsyncStream>& stream,
0090     TeardownHandler&& handler);
0091 
0092 } // beast
0093 } // boost
0094 
0095 #include <boost/beast/websocket/impl/ssl.hpp>
0096 
0097 #endif