2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_WEBSOCKET_SSL_HPP
11 #define BOOST_BEAST_WEBSOCKET_SSL_HPP
13 #include <boost/beast/core/detail/config.hpp>
14 #include <boost/beast/websocket/teardown.hpp>
15 #include <boost/asio/ip/tcp.hpp>
16 #include <boost/asio/ssl/stream.hpp>
21 /** Tear down a `net::ssl::stream`.
23 This tears down a connection. The implementation will call
24 the overload of this function based on the `Stream` parameter
25 used to consruct the socket. When `Stream` is a user defined
26 type, and not a `net::ip::tcp::socket` or any
27 `net::ssl::stream`, callers are responsible for
28 providing a suitable overload of this function.
30 @param role The role of the local endpoint
32 @param stream The stream to tear down.
34 @param ec Set to the error if any occurred.
36 template<class SyncStream>
40 net::ssl::stream<SyncStream>& stream,
43 /** Start tearing down a `net::ssl::stream`.
45 This begins tearing down a connection asynchronously.
46 The implementation will call the overload of this function
47 based on the `Stream` parameter used to consruct the socket.
48 When `Stream` is a user defined type, and not a
49 `net::ip::tcp::socket` or any `net::ssl::stream`,
50 callers are responsible for providing a suitable overload
53 @param role The role of the local endpoint
55 @param stream The stream to tear down.
57 @param handler The completion handler to invoke when the operation
58 completes. The implementation takes ownership of the handler by
59 performing a decay-copy. The equivalent function signature of
63 error_code const& error // result of operation
66 Regardless of whether the asynchronous operation completes
67 immediately or not, the handler will not be invoked from within
68 this function. Invocation of the handler will be performed in a
69 manner equivalent to using `net::post`.
72 template<class AsyncStream, class TeardownHandler>
76 net::ssl::stream<AsyncStream>& stream,
77 TeardownHandler&& handler);
82 #include <boost/beast/websocket/impl/ssl.hpp>