Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/beast/websocket/ssl.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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     @note
0031 
0032     This function serves as a customization point and is not intended
0033     to be called directly.
0034 
0035     @param role The role of the local endpoint
0036 
0037     @param stream The stream to tear down.
0038 
0039     @param ec Set to the error if any occurred.
0040 */
0041 template<class SyncStream>
0042 void
0043 teardown(
0044     role_type role,
0045     net::ssl::stream<SyncStream>& stream,
0046     error_code& ec);
0047 
0048 /** Start tearing down a `net::ssl::stream`.
0049 
0050     This begins tearing down a connection asynchronously.
0051     The implementation will call the overload of this function
0052     based on the `Stream` parameter used to consruct the socket.
0053     When `Stream` is a user defined type, and not a
0054     `net::ip::tcp::socket` or any `net::ssl::stream`,
0055     callers are responsible for providing a suitable overload
0056     of this function.
0057 
0058     @note
0059 
0060     This function serves as a customization point and is not intended
0061     to be called directly.
0062 
0063     @param role The role of the local endpoint
0064 
0065     @param stream The stream to tear down.
0066 
0067     @param handler The completion handler to invoke when the operation
0068     completes. The implementation takes ownership of the handler by
0069     performing a decay-copy. The equivalent function signature of
0070     the handler must be:
0071     @code
0072     void handler(
0073         error_code const& error // result of operation
0074     );
0075     @endcode
0076     If the handler has an associated immediate executor,
0077     an immediate completion will be dispatched to it.
0078     Otherwise, the handler will not be invoked from within
0079     this function. Invocation of the handler will be performed in a
0080     manner equivalent to using `net::post`.
0081 
0082     @par Per-Operation Cancellation
0083 
0084     This asynchronous operation supports cancellation for the following
0085     net::cancellation_type values:
0086 
0087     @li @c net::cancellation_type::terminal
0088     @li @c net::cancellation_type::partial
0089     @li @c net::cancellation_type::total
0090 
0091     if they are also supported by the socket's @c async_teardown
0092     and @c async_shutdown operation.
0093 
0094 */
0095 template<class AsyncStream, class TeardownHandler>
0096 void
0097 async_teardown(
0098     role_type role,
0099     net::ssl::stream<AsyncStream>& stream,
0100     TeardownHandler&& handler);
0101 
0102 } // beast
0103 } // boost
0104 
0105 #include <boost/beast/websocket/impl/ssl.hpp>
0106 
0107 #endif